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 と同じ形にする。 --------- 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.
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.
Overlays vanished on every design change: the same native Layer objects
were re-added to each new style, which MapLibre refuses once their core
layer was released ("Cannot add layer twice"). Each wrapper now builds a
fresh layer per style load, polygons are redrawn on load, and a style that a
newer one is replacing is not touched (it throws).
* 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 styles through setMapDesignType, and the ground image is checked in the new style (unchanged image, same design set again, removal after the change). Android is not affected by the iOS bug (ios-for-maplibre#12): setupStyle calls groundImageController.reapplyStyle() on every load. 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
MapLibreRasterLayerController.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
Relabelling street trees changes a few dozen tiled markers at once, and each change went through update() separately: - the raster source was replaced per marker, and the map fetched every visible tile again each time (45 replacements, 494 tile renders, the last tile 6.1 s after the change, on a Pixel 5a); - renderer.onPostProcess() copied all 144k entities to redraw the native ones, although nothing native had changed (50 ms each, 2.3 s in total); - the icon was baked and all entities copied just to count them. Now changes arriving within a frame share one source replacement, onPostProcess runs only when a native marker became tiled, the icon is baked only for a native marker, and the count is read without copying. Same burst: one replacement, 19 tile renders, the last tile 0.25 s after the change.
A refresh still waiting when the controller is destroyed would run afterwards and register this map's tile route again.
Redraw tiles once per burst of tiled-marker changes
Cancel a pending tile refresh on destroy
MapLibreMapViewSaver saved only styleJsonURL: the restored design had id osm-bright and no attribution rules whatever it had been. It now saves id, style URL and attributionRules. Adds a device round-trip test.
Keep the whole 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.
Nothing destroyed the MapView. Its render thread kept it, and through the camera-idle listener the old controller with every overlay, so each provider switch added a whole map to the heap. It is now destroyed through MapViewBase's onDestroyMapView. It is not stopped first: it was never started, and MapView.onStop() would deactivate the shared FileSource.
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.
MapLibrePolygonConductor 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 MapLibrePolygonController, which extends core's PolygonController, and MapLibrePolygonCompositeRenderer, 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.
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.
Redraw markers after clearing them
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 were added first (bottom), polygon z-layers were inserted below the polyline layer (so above circles), ground images went directly below the polyline layer (above polygons, and above every polygon added earlier), and a raster added after the style was set went to the very top until the next rebuild put it under the labels. MapLibreOverlayStacking records the band and zIndex of every layer the SDK adds and inserts each one below the lowest SDK layer with a higher key, reading the style's current layer list every time. Rasters additionally stay below the basemap's first label layer (as before). Marker tiles go to the bottom of the marker band, the drag layer to the top. 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: MapCameraPosition.paddings (dp) is passed to MapLibre as px on move, animate and the initial camera, and read back from the camera's padding. MapLibre then places the target at the padded-area center and solves the perspective itself. fov is 36.87, the MapLibre default (measured 36.9 on TB520FU in both orientations).
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.