简体   繁体   中英

Google Maps Api Javascript - How to position a marker by text location (not lat/long)

I'm using Google Maps V3 Javascript Api. Now, I'm adding markers to it. Is there any option to add the marker location without using latitude and longitude? Eg: I want to write only position: 'NewYork, USA'.

Thank you so much in advance!

You would need to geocode it first. You send the address to their API and get the latitude and longitude back.

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