Google 地图中多个标记的 URL [英] URL for multiple markers in Google Maps

查看:35
本文介绍了Google 地图中多个标记的 URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在桌面 Qt 应用程序中,我想在地图上显示一些 GPS 坐标.我的计划是用坐标构建一个 URL,让网络浏览器和谷歌地图或类似的服务来完成繁重的工作.

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.

mapki.com slash wiki slash Google_Map_Parameters

我可以让它对单点起作用,但是多点的 URL 语法是什么?

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?

用标记 = 替换 q= 不起作用,下面的静态地图"建议只抱怨 API 密钥不正确.

Replacing q= with markers= did not work and the "static map" suggestion below only complained about an incorrect API key.

推荐答案

对于 google maps static 有这个 URL:

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|label:C|40.718217,-73.998284&sensor=false&key=MAPS_API_KEY

详细版本:

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|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 地图中多个标记的 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆