From ce49fb2f28d610449fb6bc3b81604a964d44a12d Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Tue, 10 Nov 2026 16:16:50 -0800 Subject: [PATCH] Support bulk Circles with raster tiles --- .../com/mapconductor/here/HereMapViewController.kt | 13 +++++++++++++ .../here/raster/HereRasterLayerOverlayRenderer.kt | 11 +++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/mapconductor/here/HereMapViewController.kt b/src/main/java/com/mapconductor/here/HereMapViewController.kt index 4f18cf1..7e96fcf 100644 --- a/src/main/java/com/mapconductor/here/HereMapViewController.kt +++ b/src/main/java/com/mapconductor/here/HereMapViewController.kt @@ -1,5 +1,8 @@ package com.mapconductor.here +import com.mapconductor.core.circle.CIRCLE_TILE_LAYER_ID +import com.mapconductor.core.circle.CircleTiler +import com.mapconductor.core.circle.circleTileRasterLayerState import com.mapconductor.core.polygon.POLYGON_TILE_LAYER_ID import com.mapconductor.core.polygon.PolygonTiler import com.mapconductor.core.polygon.polygonTileRasterLayerState @@ -200,6 +203,16 @@ class HereMapViewController( } } } + circleController.tiler = + CircleTiler().apply { + onTemplate = { template, tileSize -> + if (template != null) { + rasterLayerController.upsert(circleTileRasterLayerState(template, tileSize)) + } else { + rasterLayerController.removeById(CIRCLE_TILE_LAYER_ID) + } + } + } } override fun moveCamera(position: MapCameraPosition) = handleMoveCamera(position) diff --git a/src/main/java/com/mapconductor/here/raster/HereRasterLayerOverlayRenderer.kt b/src/main/java/com/mapconductor/here/raster/HereRasterLayerOverlayRenderer.kt index 99b0943..4b15c86 100644 --- a/src/main/java/com/mapconductor/here/raster/HereRasterLayerOverlayRenderer.kt +++ b/src/main/java/com/mapconductor/here/raster/HereRasterLayerOverlayRenderer.kt @@ -14,6 +14,7 @@ import com.here.sdk.mapview.datasource.TileUrlProviderCallback import com.here.sdk.mapview.datasource.TileUrlProviderFactory import com.here.sdk.mapview.datasource.TilingScheme import com.mapconductor.core.polygon.POLYGON_TILE_LAYER_ID +import com.mapconductor.core.circle.CIRCLE_TILE_LAYER_ID import com.mapconductor.core.polyline.POLYLINE_TILE_LAYER_ID import com.mapconductor.core.raster.RasterLayerEntityInterface import com.mapconductor.core.raster.RasterLayerOverlayRendererInterface @@ -171,12 +172,18 @@ class HereRasterLayerOverlayRenderer( if (state.id.startsWith("marker-tile-")) { MapLayerPriorityBuilder().renderedLast().build() } else if (state.id == POLYGON_TILE_LAYER_ID) { + HereOverlayStacking.polygonTilePriority( + beforeLayer = layerNameOf(CIRCLE_TILE_LAYER_ID).takeIf { CIRCLE_TILE_LAYER_ID in shapeTileLayers } + ?: layerNameOf(POLYLINE_TILE_LAYER_ID).takeIf { POLYLINE_TILE_LAYER_ID in shapeTileLayers }, + ) + } else if (state.id == CIRCLE_TILE_LAYER_ID) { HereOverlayStacking.polygonTilePriority( beforeLayer = layerNameOf(POLYLINE_TILE_LAYER_ID).takeIf { POLYLINE_TILE_LAYER_ID in shapeTileLayers }, ) } else if (state.id == POLYLINE_TILE_LAYER_ID) { HereOverlayStacking.polylineTilePriority( - afterLayer = layerNameOf(POLYGON_TILE_LAYER_ID).takeIf { POLYGON_TILE_LAYER_ID in shapeTileLayers }, + afterLayer = layerNameOf(CIRCLE_TILE_LAYER_ID).takeIf { CIRCLE_TILE_LAYER_ID in shapeTileLayers } + ?: layerNameOf(POLYGON_TILE_LAYER_ID).takeIf { POLYGON_TILE_LAYER_ID in shapeTileLayers }, ) } else { HereOverlayStacking.rasterPriority() @@ -184,7 +191,7 @@ class HereRasterLayerOverlayRenderer( private fun layerNameOf(id: String) = "raster-layer-$id" - private fun isShapeTileLayer(id: String) = id == POLYGON_TILE_LAYER_ID || id == POLYLINE_TILE_LAYER_ID + private fun isShapeTileLayer(id: String) = id == POLYGON_TILE_LAYER_ID || id == CIRCLE_TILE_LAYER_ID || id == POLYLINE_TILE_LAYER_ID private fun updateLayer( handle: HereRasterLayerHandle,