I would like to know if it is possible to create an interactive map where the user will be allowed to add their own location to the map (I would use OSM as the basemap) and then calculate the distance between that location and some other objects that the map shows? If it is possible I would appreciate if you could explain to me the basic idea how it could be done. Thanks
Tell me more
×
Geographic Information Systems Stack Exchange is a question and answer site for
cartographers, geographers and GIS professionals. It's 100% free, no registration required.
|
|
The answer reside on the several sources. First you must create an html code to get the user location. It can be an html form/input (doc here). You can also use a locator (go here and choose locate) . This location you store it in a OpenLayers.LonLat (doc here), and you use it to draw the point as an Openlayers.Marker (doc enter link description here). Then you need the other point to hich to compute the distance. The distance computing can be done like here. "then calculate the distance between that location and some other objects that the map shows?" To what do you refer here? You want to select these feature on the map? Or what? |
|||||||
|

