Repository navigation
Size marker tiles like a rounding map - #20
Merged
Merged
Conversation
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.
Google Maps shows the tiles of the floored camera zoom, so at 17.75 it stretched z17 tiles by 1.68x and street-tree icons and labels came out twice as large as on MapLibre, which shows z18 at 0.84x. Pass the rounded camera zoom to MarkerTileRenderer so the tiles are drawn at the size MapLibre shows, and refresh the tiles when the rounded zoom changes.
Changing a raster layer's source removed the old tile overlay before adding the new one, so the layer vanished until the new tiles arrived. For marker tiles that is about 0.3 s, and it now happens every time a pinch crosses a half zoom (the tiles are redrawn for the rounded zoom), as well as on every relabel. Add the new overlay first and remove the old one once the new one has served its tiles and gone quiet for 150 ms (at most 1.5 s). Checked by screen recording a one-finger zoom across 17.5 on a Pixel 5a and a TB520FU: the tiles switch to the new size with no frame missing them.
The private nested class compiled into the recorded API surface. An AtomicLong does the same job without adding a class.
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.
Google Maps shows tiles of the floored camera zoom, so at 17.75 it stretched z17 tiles by 1.68x and tiled icons/labels came out twice as large as on MapLibre (z18 at 0.84x).
Passes the rounded camera zoom to
MarkerTileRenderer(displayTileZoom, MapConductor/android-sdk-core fix/tile-display-zoom) and refreshes the marker tiles when it changes.Depends on: android-sdk-core
fix/tile-display-zoom, and is stacked on #19 (perf/tiled-marker-update) — merge #19 first.Checked on Pixel 5a and TB520FU: dot size now equals MapLibre at 17.25 and 17.75.
Raster layer swap without a blank
Refreshing the tiles when a pinch crosses a half zoom made the marker layer vanish for ~0.35 s, because a source change removed the old tile overlay before adding the new one (the same blank already happened on every relabel).
GoogleMapRasterLayerOverlayRenderernow adds the new overlay first and removes the old one once the new one has served its tiles and gone quiet for 150 ms (max 1.5 s). This applies to every raster layer whose source changes.Checked by screen recording a one-finger zoom (double-tap + drag) from 17.25 across 17.5 on Pixel 5a and TB520FU: before, ~0.35 s with no markers; after, no frame without markers (the tiles switch to the new size about 0.3 s after crossing; a relabel can show old and new overlapping for one frame).