Repository navigation
Conversation
* Make bearing a clockwise map rotation bearing を「値を増やすと地図が時計回りに回る」向きに統一し、ネイティブ SDK との変換をコアの CameraBearing に集約する。 * ci: build the core module from the matching branch コアの未マージ/未リリースな変更に追随する PR を、コアが先に取り込まれるのを待たずに検証できるようにする。同名ブランチが無ければ従来どおり既定のコアを使う。 * fix: point material3 at its own version line material3 は compose-ui とは別のバージョン系列で、composeLibs(1.7.8)を流用すると存在しない material3:1.7.8 を要求して sample-app のクラスパスごと解決に失敗する。集約ビルド(android-sdk)の catalog と同じ 1.4.0 に合わせる。 --------- Co-authored-by: masashi <info@mkgeeklab.com>
MarkerTilingOptions.declutterPx existed and samples set it, but every controller dropped it on the floor when constructing MarkerTileRenderer, so the renderer ran with 0 and drew every marker on every tile. On a slow device that is the difference between an overview tile costing 538ms and 79ms (SO-02L, 144k markers, z10, MarkerTileRenderBenchmark) -- and the drawn result now actually matches what iOS and react show for the same options.
With raster layers present the map shows a composed style, which always sat on the browsing style; the design was ignored. None now composes with every browsing layer hidden and at zero opacity and without the base raster, and a design change while layers are composed recomposes instead of loading the bare style (which dropped the raster layers). Measured on the TB520FU: the SDK still draws its basemap under this style, so None is not yet effective on Android.
* Cache TomTom base style for offline startup * feat: integrate vector style support and pending map fixes * Keep each file's line endings as they are on develop The checkpoint commit rewrote whole files between LF and CRLF, which buried its real changes under line-ending noise. Content is unchanged.
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.
Redraw tiles once per burst of tiled-marker changes
- TomTomMapView never applied the state's design to the map (it used the MapOptions default) and the controller's default (Standard) was reported to the state on listener attach, so a passed-in or restored design became Standard. The design is applied first, then the listener attached. - The saver kept only the id; Custom designs (StyleDescriptor) and attribution rules were lost. It now saves the descriptor (Parcelable). - Device round-trip test.
Keep the map design across configuration changes
The polygon controller gets a PolygonTiler, whose tiles are shown through the raster layer path the marker tiles use (upsert / removeById, outside the app's RasterLayer composition). Tiled polygons stay registered for taps and give the map SDK nothing. TomTom composes rasters into its style; the polygon tiles go between the app's raster layers and the marker tiles.
The MapView went straight from resumed to onDestroy() when the map left. It is now wound down through onPause / onStop first (unless the Activity already did), and released once whether MapViewBase or the local effect gets there first.
The state kept its own controller field, set on attach and never cleared, so a state the app keeps held the destroyed controller and every overlay of the old map. It now reads the base's attached controller, which MapViewBase detaches when the map is torn down.
The geodesic ring was densified with createInterpolatePoints, which only interpolates between neighbouring points, so the closing edge (last vertex -> first) of a geodesic polygon was a straight chord in both fill and outline. Use android-sdk-core's densifyGeodesicRing. geodesic=false is unchanged. Requires the android-sdk-core release that adds densifyGeodesicRing.
clearOverlays() cleared markers, polylines, polygons and circles but not the ground image controller, and nothing removed the raster layers, so both stayed on the map (seen on the tablet: the relief raster still covered the map after clearOverlays()). It is the same kind of gap as the Mapbox circles fixed in "Clear circles in clearOverlays() too". TomTom has no RasterLayerController (rasters are folded into the composed style), so the equivalent of rasterLayerController.clear() is done here: the layers added through the public RasterLayer overlay (publicRasterLayerIds) are removed. Rasters mounted from outside the content, such as marker tiles, are left to their owners.
A geodesic=false polygon passed its raw vertices to TomTom, so every edge was a straight Web Mercator segment, unlike polylines with geodesic=false (linear lat/lng interpolation) and the other providers. Use android-sdk-core's densifyPolygonRing for both modes; it closes the ring before densifying, so the closing edge (last vertex -> first) matches the others (it replaces the unreleased densifyGeodesicRing). The linear case uses 200 km segments rather than the core's 10 km: raw vertices were used because a world-mask ring densified every 10 km made TomTom fail to draw it. A lat/lng line still bends smoothly at 200 km. Requires the android-sdk-core release that adds densifyPolygonRing.
Release the map view and the controller when the map leaves the composition
Clear ground images and raster layers in clearOverlays() too
Interpolate the closing edge of polygons, geodesic or not
Markers drawn through a StrategyMarkerController (clustering and other extension modules register these with registerOverlayController) were left on the map by clearOverlays(), which only cleared this provider's own controllers. Call BaseMapViewController.clearStrategyMarkerControllers(). Needs android-sdk-core with clearStrategyMarkerControllers() (fix/clear-strategy).
Composed rasters were appended at the end of the style, above the SDK's polygon/polyline/marker layers, so a RasterLayerState covered polygons, polylines and ground images. App rasters are now inserted before the first label or SDK overlay layer of the composed style, in zIndex order; marker tiles stay on top. TomTom's native Polygon/Polyline have no draw order and stack in add order; ground images, polygons and circle fills are all native Polygons and circle outlines are Polylines. When something is added to a lower band, the bands above it are cleared and added again so the order follows the bands. Stacking order (all providers, all platforms), bottom to top: raster layers < ground images < polygons < circles < polylines < markers. Needs android-sdk-core with OverlayStacking (fix/overlay-stacking-order).
Clear strategy markers in clearOverlays()
Put app rasters under the SDK overlays; restack native shapes by band
The polygon tiles go right above the app's raster layers, under the SDK's overlay layers and the basemap labels. The polygon band is above ground images, but TomTom draws those as native polygons (SDK overlay layers), and a style layer cannot go between them; circles, polylines and markers stay above.
Draw large polygon sets as raster tiles (PolygonTiler)
The polyline controller gets a PolylineTiler, shown through the same raster layer path as the polygon tiles. Composed into the style above the polygon tiles; restacking native polylines is skipped while tiles are in use (it would tile them all again). Whatever redraws from the polyline manager skips tiled entities (no native line).
The polyline tiles went in front of the style's first label, like the app's rasters. TomTom's style keeps drawing road lines after its first symbol layer (67 line layers on the browsing style), so the basemap's roads covered the tile roads: on the Boston roads page only paths and the edges of the other classes showed. They are now appended after every style layer (under the marker tiles), as ios-for-tomtom does. The polygon tiles stay where they were: lifting them too put them over the native circle. Checked on the tablet (overlap check, z16, colour test): polygon tiles < circle < road tiles < marker; road taps still resolve.
Draw large polyline sets as raster tiles (PolylineTiler)
restackCircles() clears every circle and adds them again, on every new ground image, polygon or circle. With the circles in tiles that tiled all of them again: at the nationwide example's 723,800 circles on a tablet, the first tiles came 24 s after the data instead of 17 s, and restoring a carrier took 13 s instead of 6 s, the tile layer gone meanwhile. The tile layer has its own order; skip the restack while circles are tiled, as restackPolylines() already does.
Support bulk Circles with raster tiles
setPadding is not used because it jumps when set. Paddings are emulated by moving the camera center and undone on read. TomTom limits the tilt by zoom (about 42 at zoom 15), so when the camera settles at a lower tilt than requested the padded center is solved again for the actual tilt. fov is 45 (no API; measured 45 on TB520FU in both orientations).
Report camera fov and apply paddings
2.7 makes MapOptions.initialCameraOptions required. Pass a minimum-zoom camera at the target position and keep moving to the real camera after the view attaches: handing over the real camera up front leaves that moveCamera with nothing to change, and with renderToTexture the first frame is then never drawn (black map on a Pixel 5a).
Update TomTom Maps SDK to 2.7.2
With 1.76, TomTom showed 0.025 zoom levels more area than Google Maps at the same unified zoom: the centre scale (coordinateForPoint ±200 px) differed by +0.025 at latitudes 0, 35.68 and 64.95 and zooms 9-19 on the TB520FU, about 1.7% on the CameraSync reference rectangles. With 1.735 the difference is within ±0.0005 from zoom 7 up, and +0.003 at zoom 5. Below that the globe and Mercator projections cannot be matched by a constant. The latitude term log2(cos φ) was already right, so only the base offset changes. iOS shows the same 0.025 offset and gets the same value.
Calibrate the TomTom zoom offset to 1.735
Release 1.4.0
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.
Merge develop into main for the 1.4.0 release.