Repository navigation
Size 3D tiled markers by the camera's level, not the tile's - #20
Merged
Merged
Conversation
The 3D SceneView picks a level per tile from the ground it covers on the globe, so one screen mixes two levels (z=10 and z=11 side by side on a Pixel at the post office sample). A tile one level deeper is shown at half the size, and its pins came out half as large as the 2D map's: 26px against 41px, next to correct ones. Tiled icons on the 3D view are now drawn at 2^(tile level - camera level), and the app's icon scale callback is asked for the camera's level, as on the 2D map. The layer is redrawn when the camera's level changes. On the same device every pin now measures 40-41px, matching the 2D map and Google.
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.
What was wrong
On the 3D
SceneView, the post office pins in some parts of the screen came out about half the size of the 2D map's: 26px against 41px on a Pixel (2.125x).The SceneView picks a level per tile from the ground it covers on the globe, so one screen mixes two levels. Tile requests at the sample's start were z=11 (55) and z=10 (35), side by side. The marker tile renderer draws every tile's icons at the same pixel size. A z=11 tile is shown at half the size of a z=10 tile, so its pins were half as large.
Fix
On the 3D view only, tiled icons are drawn at
2^(tile level − camera level). The app'siconScaleCallbackis asked for the camera's level (round(zoom)), as on the 2D map. When the camera's level changes, the marker layer is redrawn through the existingupdateRasterLayerSource.The 2D map is unchanged.
An earlier attempt drew every 3D tile at half size, assuming a fixed one-level offset. It doubled the pins that were already right, so it was dropped.
Checked on a device (Pixel, 2.125x, post office sample)
testDebugUnitTestpasses.ktlintCheckreports two existing issues, inArcGISMapView2DController.ktandArcGISRasterLayerOverlayRenderer.kt; this change does not touch either file.Not checked: zooming across a level boundary on the 3D view, which redraws the layer.