Susen Maharjan
Susen Maharjan

Reputation: 537

How to geocode location to get it's coordinates?

I want to get latitude and longitude coordinates of an address which is a dummy value while using google maps in HTML page. And then I want to show the location according to calculated coordinates. How can I achieve this feature using HTML, JavaScript and Google Maps?

Upvotes: 0

Views: 487

Answers (1)

purna
purna

Reputation: 44

https://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=YOUR_API_KEY here this url you can get the coordinates. By requesting it, we got the response data where we got the coordinates on a JSON format. For Detail info https://developers.google.com/maps/documentation/geocoding/intro

here the url to show the location using google map url https://www.google.com/maps?q={longitude},{latitude}

https://stackoverflow.com/a/5807150/8631999

Upvotes: 1

Related Questions