简体   繁体   中英

Google maps api v3 geocoding multiple addresses

I'm making a small app, that needs to geocode more addresses than google limits in one page-load, i guess. Is it possible to send in geocoder.geocode( { 'address': addreses[address][1]}, placeOnMap); with multiple addresses? Because response is supposed to give multiple.

Thank you.

The JS geocoder service is intended for addresses you cannot know when the page is loaded (for example, data provided by users). If you know addresses beforehand, you should use the webservice and store the coordinates so you don't have to re-geocode the same data over and over. To do otherwise is wasteful of Google's resources and your users' time (because the page will wait for the geocoder to do its stuff instead of having all the data provided with the page code).

This question and my answer are also relevant. You can use the solution there to geocode a number of addresses and get their coordinates in order to store them for future use.

Note that the Google Terms of Service only allow you to store their data for use on Google Maps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM