How do I get location name or city using latitude & longitudes?

前端 未结 1 1839
忘掉有多难
忘掉有多难 2021-02-13 13:04

I\'m using the below code, but how to get the city name or the location name from the longitude & latitude?

var x=document.getElementById(\"location\");
func         


        
1条回答
  •  故里飘歌
    2021-02-13 13:53

    You can use the Google Maps v3 API to perform reverse geocoding on a latitude and longitude pair. You can find an example of how to do that here: https://developers.google.com/maps/documentation/geocoding/#ReverseGeocoding.

    0 讨论(0)
提交回复
热议问题