Skip to content

Put the version into the marker tile URL - #22

Merged
wf9a5m75 merged 1 commit into
developfrom
fix/tile-url-version
Nov 5, 2026
Merged

wf9a5m75 merged 1 commit into
developfrom
fix/tile-url-version

Conversation

@wf9a5m75

@wf9a5m75 wf9a5m75 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

What

LocalTileServer.urlTemplate(routeId:version:) now puts version into the URL path (.../v{version}/{z}/{x}/{y}.png). Before this, it threw version away and returned the same URL every time.

The deprecation message now points to urlTemplate(routeId:tileSize:cacheKey:). The old message recommended urlTemplate(routeId:tileSize:), which has no version either.

Why

  • Tiles are served with a long Cache-Control.
  • While the URL stayed the same, the map never fetched again a tile it had already drawn.
  • So a change to a tiled marker (icon, label, position) reached only tiles that came into view later.
  • A label that crossed a tile seam was cut in half, because the tile next to it was still the old picture.

MapLibre, Mapbox, MapTiler and Mappls build their marker tile URL with this method.

Checked

On an iPad, with the street-tree sample (144k markers) on MapLibre:

  • Changed labels in place, then counted how many already-drawn tiles were drawn again.
  • Before: 0. After: 45.
  • MapTiler (50) and Mappls (47) behave the same.

urlTemplate(routeId:version:) dropped the version, so the URL never changed.
Tiles are served with a long Cache-Control, and the map kept the tiles it had
already drawn: a marker change reached only tiles that came into view later,
and a label crossing a seam was cut where the neighbour was still the old
picture. MapLibre, Mapbox, MapTiler and Mappls build their URL this way.
@wf9a5m75
wf9a5m75 merged commit 6f68948 into develop Nov 5, 2026
2 checks passed
@wf9a5m75
wf9a5m75 deleted the fix/tile-url-version branch November 5, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant