Returns latitude and longitude by dropping a point on the map, moving the pointer around the map or by location search.
Use Google Maps to find the latitude and longitude of any point. This is intended to be used in an application where you need to capture the latitude and longitude of a point specified by a user on the map. Latitude and longitude will be returned in one of three ways:
- Click any point on the map to drop a map marker
- Drag the map marker to any point on the map
- Use the search field to find geocoded locations from Google Maps
Using the location search method will return a reverse geocoded lat/lng for that address. Placing a pin on the map will return the lat/lng for that point, which should be more accurate than the location search.
This example includes only basic css for styling the page, you will want to apply your own styles to the form elements.
- jQuery
- jQuery UI - Used for the location search autocomplete
- Google Maps API v3
Open map.html in your broswer.
Location search based on Robbie Shade's example: http://rjshade.com/2012/03/27/Google-Maps-autocomplete-with-jQuery-UI/