Skip to content

Sample work · Maps & Locations

Customer Map: Locations on a Map, Distances to the Warehouse

Locations from a table as markers on an OpenStreetMap map, with distance to the warehouse in the popup. The distance calculation was checked against known routes.

Sample work (demo), not a client job. Built as a trial task with invented example data; the check figures below come from the automatic test run and are not polished.

What was built

  • Map using Leaflet, all markers in view, popup with name and distance
  • Distances according to the Haversine formula, as a table for further use
  • The locations are fictitious businesses in city centers

Screenshot from the test run: Customer Map: Locations on a Map, Distances to the Warehouse

Download kundenkarte-demo.zip

The map loads map tiles from OpenStreetMap when opened. Therefore, it does not run live here, but is available as a screenshot and as a downloadable file.

How it was checked

Automatic test run on 2026-10-31, taken from the log (test data invented, figures measured):

  • Haversine checked against 4 known routes (tolerance 0.5 %): {'Berlin-Paris': 877.5, 'London-Paris': 343.6, 'New York-London': 5570.2, 'Sydney-Auckland': 2155.9}
  • Symmetry/antipodes/triangle inequality ok
  • Map headless: 13 markers (12 test customers + warehouse), all in view, popup with distance correct

Limits

What this sample does not cover, so nobody expects more:

  • Coordinates must be provided - converting addresses into coordinates (geocoding) is not part of the sample (Nominatim is free, but limited to 1 request/s; commercial geocoders cost money)
  • Haversine = as-the-crow-flies distance on a sphere (deviation from the ellipsoid up to ~0.5 %); no road distance / travel time (would require OSRM/GraphHopper)
  • OSM tiles only with attribution and for low load; high traffic requires a dedicated tile server / provider
  • Leaflet is loaded once from unpkg on the first run (locally cached afterwards); without a network and without a copy, the sample fails

Something like this for your business?

Describe briefly what you need. You get a fixed price before I start; nothing happens without your yes.

To the workshop