Repository navigation
Draw marker tiles to the size of the rounded camera zoom - #22
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
MarkerTileRenderertakes an optionaldisplayTileZoom(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), andiconScaleCallbackis 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 (
apiDumpupdated).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).