Delivery routes and the map
The delivery route view on POS > Fulfillments starts and ends at the shop's route start, draws the road line through the stops, and uses the shop's own map tiles: a drawn map from OpenStreetMap and an aerial photo of Bonaire. No tile request goes to a third party while the screen is open.
Where a route starts and ends
Two settings groups in Settings > POS > Delivery hold this. They live in the
shop's settings document (extra_attributes), not in a table of their own.
| Setting | Meaning |
|---|---|
route_start_address | The address written next to the route start. Empty: the shop's contact address, else its legal address. |
route_start_latitude, route_start_longitude | The route start pin. Empty: shop_latitude / shop_longitude. |
route_end_mode | return (default): the route comes back to the start. none: it ends at the last stop. custom: it ends at its own address. |
route_end_address | The written address for custom. |
route_end_latitude, route_end_longitude | The end pin for custom. Empty: the route start. |
shop_latitude / shop_longitude keep their other job: the delivery-radius
check at checkout. The route start falls back to them, so a shop that already
had a shop pin keeps working without setting anything.
The point is a map pin. The address field is a label and a lookup: typing an
address and choosing Find on map asks our own Photon geocoder
(POST /api/v1/applications/current/route_point) and places the point. The pin
can also be clicked or dragged, and the coordinates can be typed.
What the route endpoints answer
GET /api/v1/delivery/route_plans/:id/route carries the route start and end
beside the line and the stops:
{
"provider": "osrm",
"start": {"lat": 12.167576, "lon": -68.271355},
"end": {"lat": 12.167576, "lon": -68.271355},
"end_mode": "return",
"start_address": "Kaya Barakuda, Antriol, Kralendijk",
"shop": {"lat": 12.167576, "lon": -68.271355},
"geometry": [[12.167576, -68.271355], [12.17, -68.272]],
"stops": [],
"distance_m": 9120,
"duration_s": 1200
}shop repeats start for older screens. end is null when the route does
not come back. A route with no start point at all is planned open, first stop
to last.
The driving order
- Back at the start: OSRM's
tripservice withroundtrip=true,source=first,destination=any. - End elsewhere:
roundtrip=falsewithsource=firstanddestination=last, the custom end being the last waypoint. - No return, no custom end: OSRM's trip service only accepts
roundtrip=falsetogether withsource=firstanddestination=last, so the order is nearest neighbour from the start. The road line still comes from OSRM'srouteservice, so the screen's "Road route" label is true for the line. The order is not the open-route optimum. - Without a reachable OSRM: nearest neighbour and straight lines, and the screen says so.
The tile server
commerce-tiles is a small nginx image built from tiles/ and run beside the
API. It is published under /tiles/ on the admin's own host
(tienda.shilohbv.com), so no new host name is needed.
| Path | Content |
|---|---|
/tiles/vector.pmtiles | Vector tiles, OpenMapTiles schema, Bonaire + Curaçao + Aruba. |
/tiles/satellite/{z}/{x}/{y}.jpg | The open aerial photo of Bonaire, Web Mercator raster tiles. |
/tiles/fonts/{fontstack}/{range}.pbf | MapLibre label glyphs (Noto Sans Regular and Bold, Latin ranges). |
/tiles/health.json | Which layers the image carries; the admin reads it before creating a map. |
The admin points map_tiles_base_url at this base (empty means /tiles),
opens on map_default_layer (satellite by default), and shows the Map /
Satellite switch when health.json says the photo is present.
Building the data
bash tiles/build.sh builds everything:
- Vector tiles. Planetiler (pinned version and SHA-256), OpenMapTiles
schema, from the Geofabrik Central America extract, cropped to
-70.3,11.9,-68.0,12.8at maximum zoom 14, written as PMTiles. - Aerial photo.
tiles/fetch_satellite.pycopies the Dataroom Caribisch Nederland mosaic (2025-05-27_0_rgb) at zoom 10–16 for the whole island and zoom 17 for the built-up band, converts the PNG tiles to JPEG, and skips the tiles that are plain sea. Roughly 1.2 m per pixel in the built-up band and 2.4 m elsewhere; the source does not publish its ground sample distance. - Fonts. Two glyph ranges for two fonts from openmaptiles/fonts, pinned to a commit.
CI runs this only when tiles/** changes or on the quarterly refresh (the
same cron as the OSRM road refresh), then builds and publishes the
commerce-tiles image. Its tag is not pinned to the code commit: the image
changes quarterly, not with every release.
Licences and attribution
| Data | Licence | Attribution shown |
|---|---|---|
| OpenStreetMap, through OpenMapTiles | ODbL 1.0; OpenMapTiles credit required | © OpenMapTiles © OpenStreetMap contributors |
| Aerial photo of Bonaire | CC BY 4.0, het Waterschapshuis / Beeldmateriaal Nederland | Aerial photo: Het Waterschapshuis / Beeldmateriaal Nederland (CC BY 4.0) |
| Noto Sans glyphs | SIL Open Font License 1.1 | (none required) |
tiles/NOTICE repeats this. The imagery is copied to our own server under the
CC BY 4.0 terms; the source's WMS/WMTS is not called at runtime.
When the tile server does not answer
health.json failing makes the map use the shop's map_tile_url raster
fallback if one is set, and otherwise a plain background with the route line
and pins on it. It does not silently switch to a public tile server: with
map_tile_url empty, no third-party tile request is made.