Google Maps URL平铺服务器API和文档?

问题描述 投票:0回答:1

我想在我的Wolfram Language项目中使用谷歌地图瓷砖作为地图。目前有18 Google Maps APIs,我想我需要Static Maps API。但是,此API似乎返回整个地图而不是单个切片。

我需要哪个API作为Wolfram语言GeoServer函数中Maps & Cartography选项的URL切片服务器?此外,Google的文档中哪里有URL平铺服务器的官方文档?

Update

从@ChrisDegnen回答下面我认为静态地图API是唯一的选择。然而。我想使用地图作为Wolfram语言中现有地图和制图功能的背景。不幸的是,Static Map API不允许显式指定lat-long边界,因此它不适合。

例如,使用"visible“参数来映射美国大陆以设置地图边界。

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|"

Static Map API返回this map(我的个人密钥已被删除)。

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

enter image description here

与默认的GeoGraphics映射相比,Static Map API添加了太多的填充。

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

enter image description here

这个额外的填充将抛弃我在代码中添加到地图中的任何内容。所以最后我不能使用谷歌地图。

google-maps-api-3 wolfram-mathematica wolfram-language
1个回答
1
投票

Mathematica文档演示了如何使用Static Maps API,如果有任何帮助的话。

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

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.