A
A
Aidos Meldekhanov2016-03-04 22:40:00
ASP.NET
Aidos Meldekhanov, 2016-03-04 22:40:00

How to give the user the ability to select a location on the map and store the coordinates of the selected location in the database?

I want to create a form that the user will fill in some data. And in this form I want to put a map which the user will indicate the location (of the subject, its location ... ). I need to do so that when receiving data from a form on the server, the coordinates of the selected place by the user come. And what card is better to choose?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Edward, 2016-03-04
@ED98

You can use the Leaflet library to display the map. This page has an example of usage and links to documentation and examples: leafletjs.com
You need to process a click on the map, get the coordinates and send it to the server along with other data from the form.

A
Alexander, 2016-03-04
@NeiroNx

Yes, you can implement it on any engine - even on Yandex, even on Google. The bottom line is that the value in the form field gets when the user pokes on the map. The value can be stored as a string or in two float variables. If you store it as a string, it will be more difficult to search for the nearest values ​​​​in the database (points within a radius of XXXm).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question