How do I link to Google Maps with a particular longitude and latitude?

前端 未结 15 2199
夕颜
夕颜 2020-12-02 04:49

I have a small application that gives the current location: longitude and latitude. Now I have to browse to google maps with the longitude and latitude. Please suggest how I

相关标签:
15条回答
  • 2020-12-02 05:12

    To get your current location as start point you need to use this URL:

    https://www.google.com/maps/dir/?api=1&origin=Current+Location&destination=<latitude>,<longitude>
    

    You can fill up the destination parameter with the address, name or latitude and longitude values.

    0 讨论(0)
  • 2020-12-02 05:16

    As of today (1st November, 2020), Google provided a provision of Universal URL which works quite efficiently on cross-platforms and thus, Google recommends this method.

    Syntax: https://www.google.com/maps/search/?api=1&query=<lat>,<lng>

    Example : https://www.google.com/maps/search/?api=1&query=28.6139,77.2090 (New Delhi, India)

    Documentation/Source.

    0 讨论(0)
  • 2020-12-02 05:17

    This schema has changed again (23rd October 2018). See Kushagr's answer for the latest.

    This for a map with the marker (via aaronm's comment):

    https://www.google.com/maps/?q=-15.623037,18.388672

    For an older example (no marker on this one):

    https://www.google.com/maps/preview/@-15.623037,18.388672,8z

    The oldest format:

    http://maps.google.com/maps?ll=-15.623037,18.388672&spn=65.61535,79.013672

    0 讨论(0)
  • 2020-12-02 05:17

    Open the following url with the latitude and longitude and zoom level.

    https://maps.google.com/?q=23.22,88.32&z=8

    0 讨论(0)
  • 2020-12-02 05:18

    say easily http://www.google.com/maps/place/lat,lng format

    sample url:

    http://www.google.com/maps/place/30.364124,48.227034

    0 讨论(0)
  • 2020-12-02 05:20

    The best way is to use q parameter so that it displays the map with the point marked. eg.:

    https://maps.google.com/?q=<lat>,<lng>
    
    0 讨论(0)
提交回复
热议问题