How can I get city name from a latitude and longitude point?

后端 未结 11 1210
感情败类
感情败类 2020-11-28 03:07

Is there a way to get a city name from a latitude and longitude point using the google maps api for javascript?

If so could I please see an example?

11条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-28 03:12

    Here is the latest sample of Google's geocode Web Service

    https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&key=YOUR_API_KEY

    Simply change the YOUR_API_KEY to the API key you get from Google Geocoding API

    P/S: Geocoding API is under Places NOT Maps ;)

提交回复
热议问题