This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Display result (from local db) by location distance.

0

Hi everyone,

I have a tiny website with a SQLite DB.

I would like to display some result based on location. Sorted by distance from the visitor.

The result will be display has a pure html output (table etc..) and trough a map (I'm currently using leafletjs / OSM )

But I have no idea where to start.. how store the location, how grab the position of the visitor and how sort the delta.

Thanks.

asked 18 Mar '23, 06:20

Rick%20from%20C-137's gravatar image

Rick from C-137
16223
accept rate: 0%

edited 20 Mar '23, 07:02

It sounds like this is mostly or all about web programming rather than OSM per se.

An example of something that does geolocation in Leaflet is here, but I'm sure that there are better examples on Leaflet's own site.

As for the rest of it (sorting data etc.), I'd suggest finding one of the "Stack" sites with relevant content.

(24 Mar '23, 13:16) SomeoneElse ♦

Source code available on GitHub .