From 28e3ada66338528b983e408389bbbef3e5ae78b2 Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Sat, 7 Nov 2026 05:40:54 -0800 Subject: [PATCH 1/2] Draw large polygon sets as raster tiles (PolygonTiler) 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. --- .../googlemaps/GoogleMapViewController.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/com/mapconductor/googlemaps/GoogleMapViewController.kt b/src/main/java/com/mapconductor/googlemaps/GoogleMapViewController.kt index fc5a19b..55dd3a9 100644 --- a/src/main/java/com/mapconductor/googlemaps/GoogleMapViewController.kt +++ b/src/main/java/com/mapconductor/googlemaps/GoogleMapViewController.kt @@ -28,6 +28,9 @@ import com.mapconductor.core.marker.StrategyMarkerController import com.mapconductor.core.marker.dispatchGeoMarkerClick import com.mapconductor.core.marker.dispatchNativeMarkerClick import com.mapconductor.core.polygon.OnPolygonEventHandler +import com.mapconductor.core.polygon.POLYGON_TILE_LAYER_ID +import com.mapconductor.core.polygon.PolygonTiler +import com.mapconductor.core.polygon.polygonTileRasterLayerState import com.mapconductor.core.polyline.OnPolylineEventHandler import com.mapconductor.core.polyline.PolylineState import com.mapconductor.googlemaps.circle.GoogleMapCircleController @@ -96,6 +99,19 @@ class GoogleMapViewController internal constructor( markerTileLayers.forEach { entity -> rasterLayerController.removeById(entity.state.id) } } } + + // Many polygons are drawn as raster tiles, shown through the same RasterLayer + // controller as the marker tiles (upsert / removeById, never the app's layers). + polygonController.tiler = + PolygonTiler().apply { + onTemplate = { template, tileSize -> + if (template != null) { + rasterLayerController.upsert(polygonTileRasterLayerState(template, tileSize)) + } else { + rasterLayerController.removeById(POLYGON_TILE_LAYER_ID) + } + } + } } override fun moveCamera(position: MapCameraPosition) = handleMoveCamera(position) From 1d6266036bd045d2485e80266ee248b99c3edf45 Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Mon, 9 Nov 2026 06:51:42 -0800 Subject: [PATCH 2/2] Stack the polygon tiles at the bottom of the polygon band With develop's OverlayStacking, a raster layer goes in the raster band, under ground images. The polygon tiles are polygons drawn as images, so they go over ground images and under circles, polylines and markers. --- .../googlemaps/raster/GoogleMapRasterLayerOverlayRenderer.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/mapconductor/googlemaps/raster/GoogleMapRasterLayerOverlayRenderer.kt b/src/main/java/com/mapconductor/googlemaps/raster/GoogleMapRasterLayerOverlayRenderer.kt index 75c7c4b..0925f7a 100644 --- a/src/main/java/com/mapconductor/googlemaps/raster/GoogleMapRasterLayerOverlayRenderer.kt +++ b/src/main/java/com/mapconductor/googlemaps/raster/GoogleMapRasterLayerOverlayRenderer.kt @@ -7,6 +7,7 @@ import com.google.android.gms.maps.model.TileProvider import com.google.android.gms.maps.model.TileProvider.NO_TILE import com.mapconductor.core.controller.OverlayKind import com.mapconductor.core.controller.OverlayStacking +import com.mapconductor.core.polygon.POLYGON_TILE_LAYER_ID import com.mapconductor.core.raster.RasterLayerEntityInterface import com.mapconductor.core.raster.RasterLayerOverlayRendererInterface import com.mapconductor.core.raster.RasterLayerSource @@ -100,6 +101,9 @@ class GoogleMapRasterLayerOverlayRenderer( if (isMarkerTileRaster(state)) { // マーカーのタイルはマーカーの帯(ポリラインより上)。 OverlayStacking.flatZIndex(OverlayKind.Marker, Int.MIN_VALUE) + } else if (state.id == POLYGON_TILE_LAYER_ID) { + // ポリゴンのタイルはポリゴンの帯の一番下(GroundImage より上、ネイティブのポリゴンより下)。 + OverlayStacking.flatZIndex(OverlayKind.Polygon, Int.MIN_VALUE) } else { OverlayStacking.flatZIndex(OverlayKind.RasterLayer, state.zIndex) }