Create Google Maps links based on coordinates

不打扰是莪最后的温柔 提交于 2019-11-28 16:59:43

问题


How can I create Google Maps links based on coordinates. Their new basic share urls contain a lot of parameters, for example -

https://www.google.com/maps/place/Vetlanda,+Sweden/@57.4217311,15.0849255,13z/data=!3m1!4b1!4m2!3m1!1s0x465758d912d321b5:0x55675191e550be84?hl=en

Any ideas? Not looking to embed but just to create external links that can be shared.


回答1:


Why not http://www.google.com/maps/place/lat,lng I think this is the simplest way

http://www.google.com/maps/place/49.46800006494457,17.11514008755796




回答2:


According to another answer, you can use following url

http://maps.google.com/maps?q=24.197611,120.780512

to show a pin.




回答3:


The currently accepted answer ends up adding an additional history entry in browsers at the moment as Google Maps redirects to a different URL format.

To avoid that extra entry in the browser's history, use the official Maps API url:

https://www.google.com/maps/search/?api=1&query=latitude,longitude

This will display a marker at the latitude, longitude location as well.

If you only want to center the map (and not display a marker), use the map action:

https://www.google.com/maps/@?api=1&map_action=map&center=latitude,longitude



回答4:


The simple and best way is to use as follows:-

https://maps.google.com/?q=latitude-value,longitude-value

Hope it helps. Thank you!



来源:https://stackoverflow.com/questions/30544268/create-google-maps-links-based-on-coordinates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!