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();
latitude=marker. getPosition(). lat(); longitude=marker. getPosition().
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.
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().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With