0
votes

I would like to use Google Maps tiles for maps inside of my Wolfram Language projects. There are currently 18 Google Maps APIs and I think I need the Static Maps API. However, this API appears to return whole maps instead of individual tiles.

Which API do I need for use as a URL tile server for the GeoServer option in the Wolfram Language Maps & Cartography functions? Also, where is there official documentation of the URL tile server in Google's documentation?

Update

From @ChrisDegnen answer below I think the Static Map API is the only option. However. I wanted to use the map as a background to the existing Maps & Cartography functions in the Wolfram Language. Unfortunately, the Static Map API does not allow explicit specification of the lat-long boundaries so it is not a good fit.

For example to map the continental USA using the "visible" parameter to set the map bounds.

visible =
 StringReplace["\n" -> "|"]@
  ExportString[
   Flatten[Outer[List, Sequence @@ GeoBounds[Entity["Country", "UnitedStates"]]], 1], 
   "CSV"]
"25.1246466,-124.733151|25.1246466,-66.949806|49.3844900814454,-124.733151|49.3844900814454,-66.949806|"

The Static Map API returns this map (my personal key having been removed).

URLExecute["http://maps.googleapis.com/maps/api/staticmap",
 {
  "size" -> "600x300",
  "visible" -> visible,
  "key"-> "mykey" 
  }
 ]

enter image description here

The Static Map API adds far too much padding when compared to the default GeoGraphics map.

GeoGraphics[{Entity["Country", "UnitedStates"]},
 ImageSize -> {600, 300}]

enter image description here

This extra padding will throw off anything I add to the map in my code. So in the end I can't use the Google maps.

1
You are only allowed to access Google Maps Tiles through the Google Maps API.geocodezip
@geocodezip Yes, I know I need to use the API. I am asking which API I need to use to get the tiles.Edmund
I don't see how this question could be closed for being too broad. It is a very narrow question on a specific bit of functionality.Edmund

1 Answers

1
votes

The Mathematica documentation demonstrates use of the Static Maps API, if that's any help.

https://www.wolfram.com/mathematica/new-in-10/url-manipulation/call-urls-like-functions.html

URLExecute[
 "http://maps.googleapis.com/maps/api/staticmap",
 {"center" -> "Brooklyn Bridge,New York,NY",
  "zoom" -> "13", "size" -> "600x300"}, "Method" -> "GET"]

enter image description here