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 に合わせる。 * fix: declare material-icons-core for the sample app sample-app が Icons.AutoMirrored を使うが、material3 は material-icons を推移的に持ってこないため単体ビルドで Unresolved reference 'Icons' になる。版は compose BOM 任せで、集約ビルドの catalog と同じ形にする。
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.
A raster overlay was appended at the top of the style, above the place names, road names and shields the backend draws. The vector tile sample showed what that costs: our own roads run straight through the district names, which reads as "the labels are drawn under the lines". A heatmap or a satellite layer hid them outright. Anchoring to the style's first symbol layer puts the overlay above the basemap's geometry and below its labels, which is where a tile overlay belongs. Inserting successive layers below the same anchor preserves their order, so the z-order among our own raster layers is unchanged. Our own layers are skipped when looking for the anchor: markers are a symbol layer too, and anchoring to them would put the raster back above the labels -- and only once a marker existed. Marker tiles keep their own rule (below the marker symbol layer), so native markers still draw above everything.
getValue() hands the blank style JSON itself; loadStyle and MapInitOptions.styleUri both take a URI or JSON string.
* 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.
Instrumented: a real MapView loads two local style documents through setMapDesignType, and the ground image is checked in the new style (unchanged image, same design set again, removal after the change). The styles have no sources, so a placeholder access token is enough. Android is not affected by the iOS bug (ios-for-maplibre#12): the style-loaded subscription calls groundImageController.reapplyStyle(). Removing that call makes all three fail.
CI builds the repository on its own, against gradle/libs.versions.toml here, which had no androidx-runner or ui-test entries; they resolved only in the android-sdk monorepo's catalog the tests were first built with. Compose test artifacts follow this repo's composeLibs (1.12.1).
Test that a ground image survives a map design change
The template was copied from android-for-googlemaps and still expected com.mapconductor.googlemaps, so connectedAndroidTest always failed here. A library's instrumented tests run in its test APK, whose package is com.mapconductor.mapbox.test.
Expect this library's own test package in ExampleInstrumentedTest
MapboxRasterLayerController.reapplyStyle() read the manager outside the controller lock and registered what it read again. Drop it and use the one in android-sdk-core's RasterLayerController (MapConductor/android-sdk-core#17), which runs under the lock.
Use the core reapplyStyle() for raster layers
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. - onPostProcess runs only when a native marker became tiled (it copies every entity to redraw the native ones).
Redraw tiles once per burst of tiled-marker changes
- The saver kept only the id: StyleUri came back as a mapbox://styles/mapbox Custom and attribution rules were lost. It now saves the kind and rules. - On style load the state was replaced by a design rebuilt from the style URI, dropping attribution rules even without a rotation. A report with the same style value now keeps the current design. - 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. The polygon tile layer goes where the SDK's polygon layers do: over the basemap, under polylines and markers.
Only the Activity's real ON_DESTROY destroyed the MapView, so a provider switch left it alive with the controller it reaches. It is now stopped and destroyed through MapViewBase's onDestroyMapView, once.
Mapbox's lifecycle plugin registers component callbacks on the Activity and observes the view tree's lifecycle, and lets go only when that lifecycle is destroyed; MapView.onDestroy() does not undo it. Under the Activity's lifecycle every MapView the user switched away from (and through its click listeners the controller) stayed until the Activity went. The MapView now gets a MapViewLifecycleOwner, ended in onDestroyMapView: the plugin then stops and destroys it and unregisters what it registered.
core's PolygonController.destroy() releases its tiler (02369fa), but this provider's own polygon conductor does not extend it and its destroy() was empty, so the tile server kept every destroyed map's tiled polygons.
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 polygon conductor's destroy() clears its polygon and outline managers, as core's PolygonController now does.
MapboxPolygonConductor implemented SlottedOverlayController by hand because it drives two renderers (fill + a polyline per outline, since a fill layer cannot draw a stroke wider than 1 px). Every change to core's PolygonController had to be copied over, and it was missed twice. Replace it with MapboxPolygonController, which extends core's PolygonController, and MapboxPolygonCompositeRenderer, which presents the existing fill and outline renderers as one renderer. The fill renderer's onRemove now redraws without the removed polygons, since core's clear() does not call onPostProcess.
…change makes it untileable Setting geodesic on a tiled polygon in place, or giving it points that span half the world or fewer than three, kept it in the tiles. update() now checks canTile and, when it fails, takes the polygon out of the tiles and draws it natively. It stays on the map, so this is not an add.
clearOverlays() cleared every overlay controller except circleController, so circles stayed on the map. The other providers already clear it.
The marker controller's clear() emptied the manager, but onRemove only drops icon references; the GeoJSON source is rewritten from the manager in onPostProcess, which clear() never called. The markers stayed on the map after clearOverlays(). Call it once the manager is empty, the same order the core controllers use.
Clear circles and redraw markers in clearOverlays()
Release the map view and the controller when the map leaves the composition
The conductor that develop's teardown change touched is gone here; its destroy() cleared the polygon and outline managers. Core's PolygonController now clears the polygon manager on destroy, and this controller clears the outline renderer's manager on top.
Extend core PolygonController for polygons (drop hand-copied conductor)
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).
Before: circles, then polylines were appended, polygon z-layers went below the polyline layer (above circles) and ground images directly below the polyline layer (above polygons). With the Standard style the basemap is an import and has no label layer in styleLayers, so rasters were appended on top of every overlay. MapboxOverlayStacking records the band and zIndex of every layer the SDK adds and inserts each one below the lowest SDK layer with a higher key. Rasters stay below the basemap's first label layer when the style has one. 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()
Stack overlays by band, independent of add order and style reloads
develop replaced the polygon conductor with a controller that extends core's PolygonController, which already routes polygons through the tiler, moves an untileable one to native drawing, and disposes the tiler on destroy. The conductor's tiling is dropped with it; the fill renderer now leaves out the tiled entities (no features) when it redraws. The polygon tiles are stacked with OverlayStacking: at the bottom of the polygon band (over raster layers and ground images, under circles, polylines and markers), where the anchor list used to put them.
Additions only: the polygon tiles' stacking key, and declarations develop added without running apiDump (TILE_REFRESH_COALESCE, and on ArcGIS the marker controller's constructor that takes a boolean).
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. Stacking key (Polyline, Int.MIN_VALUE): over circles, under native polylines and markers. Whatever redraws from the polyline manager skips tiled entities (no native line).
Draw large polyline sets as raster tiles (PolylineTiler)
Support bulk Circles with raster tiles
The symbol sort key is now zIndex first, then south and west, recomputed from the current state on every change. Unspecified markers in the southern hemisphere no longer outrank an explicit zIndex.
Same-zIndex markers follow the screen position (lower in front) and are re-sorted after rotation settles.
Stack markers by the shared draw order
The padding TODO is enabled: paddings (dp) go to CameraOptions.padding as px on move, animate and the initial camera, and are read back from CameraState.padding. fov is 36.87 (measured 36.9 on TB520FU).
Report camera fov and apply paddings
Native padding widens the frustum upward. Under tilt a large top padding reaches past the horizon: the engine loads tiles out to it and stalls, and MapLibre also lowers the pitch (60 -> 55.4 deg) and clamps the padding. The target is now placed at the padded centre by moving the camera centre with CameraPaddingEmulation and the provider's fov; native padding is always zero. Read-back undoes the shift, and padding on the initial camera is applied once the map has a size.
Apply paddings by shifting the camera centre
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.