Google地图中多个标记的网址 [英] URL for multiple markers in Google Maps
问题描述
在桌面Qt应用程序中,我有一些我想在地图上显示的GPS坐标。我的计划是构建一个带有坐标的URL,并让Web浏览器和Google地图或类似的服务完成繁重的工作。
在阅读了一些显然是反向工程的文档后,
mapki。 com slash wiki斜杠Google_Map_Parameters
我可以使它适用于单点,但是什么是URL语法多点?
到目前为止,我的最佳拍档是建立一个如下所示的字符串:
http: //maps.google.com/?ie=UTF8&q=My+First+Point@59.591,17.82&q=My+Second+Point@59.592,17.82
但只会显示我的第二点。是否有更好的语法描述?
用标记替换q =不起作用,下面的静态地图建议只是抱怨不正确的API密钥。
对于google maps static有这样的网址:
http://maps.google.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=14&size=512x512&maptype=roadmap
& markers = color:blue | label | S | 40.702147,-74.015794& markers = color:green | label | G | 40.711614,-74.012318
& markers = color:red | color:red | label:C | 40.718217,-73.998284& sensor = false& key = MAPS_API_KEY
我不确定如果这种语法对于标准地图也是有用的
In a desktop Qt application, I have some GPS coordinates that I'd like to show on a map. My plan is to construct an URL with the coordinates and let a web browser and Google maps or a similar service do the heavy lifting.
After reading some apparently reverse-engineered documentation at
mapki.com slash wiki slash Google_Map_Parameters
I can make it work for a single point, but what's the URL syntax for multiple points?
My best shot so far is to build a string such as this:
http://maps.google.com/?ie=UTF8&q=My+First+Point@59.591,17.82&q=My+Second+Point@59.592,17.82
but that will only show "My Second Point". Is there a better description of the syntax somewhere?
Replacing q= with markers= did not work and the "static map" suggestion below only complained about an incorrect API key.
for google maps static there is this URL:
http://maps.google.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=14&size=512x512&maptype=roadmap
&markers=color:blue|label:S|40.702147,-74.015794&markers=color:green|label:G|40.711614,-74.012318
&markers=color:red|color:red|label:C|40.718217,-73.998284&sensor=false&key=MAPS_API_KEY
i am not sure if this syntax is also good for standard maps
这篇关于Google地图中多个标记的网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!