Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get place_id from longitude and latitude in google Map?

I can get place Id by using This Link. But problem is this is based on location search. I want to get place_id using draggeble marker so I can't use above link. I am moving the marker on Google Map, So how I can get place_id on Map.

Through marker.getPosition() we can get the latitude and longitude. So I want to know the place_id through latitude and longitude. How can I get, please tell me

latitude=marker.getPosition().lat();               
longitude=marker.getPosition().lng();
like image 953
Neelabh Singh Avatar asked Oct 15 '15 10:10

Neelabh Singh


People also ask

How can I get Google Lat Long ID?

latitude=marker. getPosition(). lat(); longitude=marker. getPosition().

How do I extract multiple coordinates from Google Maps?

First, open Google Maps on your computer, right-click the place you want to get coordinates. A pop-up window will show, you can find the latitude and longitude on the top. Left-click and copy them automatically.


1 Answers

You can either use the Geocoder API to send request, or simply send the HTTP request to the web service behind.

Your sample request:

https://maps.googleapis.com/maps/api/geocode/json?latlng=lat,lng&key=YOUR_API_KEY

You can then easily parse the JSON object by Javascript JSON.parse().

like image 52
Man Coding Avatar answered Oct 13 '22 18:10

Man Coding