Get LatLng from Zip Code - Google Maps API

前端 未结 6 724
我在风中等你
我在风中等你 2020-12-04 09:09

All I want is some simple example code that shows me how to obtain a latlng element from an inputted zip code OR a city/state.

6条回答
  •  没有蜡笔的小新
    2020-12-04 09:54

    Here is the most reliable way to get the lat/long from zip code (i.e. postal code):

    https://maps.googleapis.com/maps/api/geocode/json?key=YOUR_API_KEY&components=postal_code:97403
    

提交回复
热议问题