I would like my user to be able to select a place on a map and return me the lat and lon which can be uploaded to a database. Any help would be appreciated
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Because you are dealing with Google Maps API (based on your question’s tag), I guess taking taking advantage of the in-built API capabilities in JavaScript might help. You can go over to this place to get started learning JavaScript, you will,then read the API here, and finally will be able to post a form using JavaScript whose values have been auto-set by the JavaScript with the latitude and longitude of the point the user clicked on the map.
Here is a bit of what you might have to do, but you might need to learn some JavaScript to extend it or use it effectively:
So, assuming you create a simple html page with a form to hold the latitude and longitude like this:
Then, by modfying our clik-handler like this, we can auto-set the latitude and longitude on the form, and then have the user simply click submit to post the values to the server.