Skip to content

Show raster overlays at the rounded camera zoom - #10

Merged
wf9a5m75 merged 2 commits into
developfrom
fix/marker-tile-display-zoom
Nov 6, 2026
Merged

wf9a5m75 merged 2 commits into
developfrom
fix/marker-tile-display-zoom

Conversation

@wf9a5m75

@wf9a5m75 wf9a5m75 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

OpenMobileMaps picks the floored tile level, so at 17.75 the marker tile layer showed z17 stretched by 1.68x and tiled icons/labels came out twice as large as on MapLibre, Mapbox, HERE and ArcGIS (z18 at 0.84x).

WebMercatorTileLayerConfig gains an optional roundToNearestLevel; raster overlays set it, which uses zoom level scale factor √2 (switch half a level early = round). The base map keeps the default.

Stacked on #9 (perf/tiled-marker-update) — merge #9 first. API: one optional constructor parameter (apiDump updated).

Checked on Pixel 5a and TB520FU: dot size equals MapLibre at 17.25 and 17.75.

Not changed here: labels on this provider appear only after the first pan (same without this change).

Same change as android-for-maplibre: relabelling street trees changes a few
dozen tiled markers at once, and each update() replaced the raster source,
so the map fetched every visible tile again per marker (on MapLibre, Pixel 5a:
45 replacements, 494 tile renders, last tile 6.1 s after the change).

- Changes arriving within a frame share one tile refresh; a pending refresh is
  cancelled on destroy() so it cannot register the tile route again.
- The tiling check reads the entity count without copying all entities.
- The icon is baked only when the marker is drawn natively.
- onPostProcess runs only when a native marker became tiled (it copies every
  entity to redraw the native ones).
OpenMobileMaps picks the floored level, so at 17.75 the marker tile layer
showed z17 stretched by 1.68x, and street-tree icons and labels came out
twice as large as on MapLibre, Mapbox, HERE and ArcGIS, which show z18 at
0.84x. Raster overlays now switch levels half a step early (zoom level scale
factor sqrt 2), which makes the pick round to the nearest level. The base map
keeps the default.
@wf9a5m75
wf9a5m75 merged commit bd55ca9 into develop Nov 6, 2026
2 checks passed
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