Skip to content

Draw marker tiles to the size of the rounded camera zoom - #22

Merged
wf9a5m75 merged 1 commit into
developfrom
fix/tile-display-zoom
Nov 6, 2026
Merged

wf9a5m75 merged 1 commit into
developfrom
fix/tile-display-zoom

Conversation

@wf9a5m75

@wf9a5m75 wf9a5m75 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Map SDKs differ in which tile zoom they show at a fractional camera zoom. MapLibre, Mapbox, Mappls, TomTom, HERE and ArcGIS round it; Google Maps and OpenMobileMaps floor it. At 17.75 the first group shows z18 at 0.84x and the second z17 at 1.68x, so tiled icons and labels came out twice as large on Google Maps / OpenMobileMaps.

MarkerTileRenderer takes an optional displayTileZoom (the camera zoom rounded). Given it, a tile of another zoom is drawn so it looks like the rounded zoom's tile once the map stretches it: icons, labels, declutter cells and query padding scale by 2^(z - displayZoom), and iconScaleCallback is asked for the rounded zoom. The renderer drops its own cached tiles when the value changes; refreshing the map's cache is the caller's job.

Without the parameter nothing changes. API: one optional constructor parameter added (apiDump updated).

Used by MapConductor/android-for-googlemaps (OpenMobileMaps fixes it with its own zoom-level setting instead).

Dot size on the street-tree sample, Pixel 5a / TB520FU, all 8 providers: 35–38 / 28–30 px at 17.25, 25–27 / 20–21 px at 17.75 (Google Maps was 50 px at 17.75 on the Pixel before).

Map SDKs differ in which zoom of tile they show at a fractional camera zoom.
MapLibre, Mapbox, HERE and ArcGIS round it; Google Maps and OpenMobileMaps
floor it. At 17.75 the first show z18 at 0.84x and the second z17 at 1.68x,
so the same icons and labels came out twice as large on the second group
(measured on a Pixel 5a and a TB520FU).

MarkerTileRenderer takes an optional displayTileZoom: the camera zoom
rounded. Given it, a tile of another zoom is drawn so that it looks like the
rounded zoom's tile once the map has stretched it: icons, labels, declutter
cells and the query padding all scale by 2^(z - displayZoom), and the icon
scale callback is asked for the rounded zoom. The renderer drops its own
cached tiles when the value changes; the map's cache is the caller's.
@wf9a5m75
wf9a5m75 merged commit c2bbcfd 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