Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ internal object MapplsOverlayStacking {
/** ポリゴンのタイル(ラスター): ポリゴンの帯の一番下。 */
val POLYGON_TILE = key(OverlayKind.Polygon, Int.MIN_VALUE)

/** 円のタイル(ラスター): サークルの帯の一番下(ポリゴンの上、ネイティブの円とポリラインのタイルの下)。 */
val CIRCLE_TILE = key(OverlayKind.Circle, Int.MIN_VALUE)

/** ポリラインのタイル(ラスター): ポリラインの帯の一番下(サークルの上、ネイティブのポリラインの下)。 */
val POLYLINE_TILE = key(OverlayKind.Polyline, Int.MIN_VALUE)

Expand Down
15 changes: 15 additions & 0 deletions src/main/java/com/mapconductor/mappls/MapplsViewController.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.mapconductor.mappls

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.circle.OnCircleEventHandler
import com.mapconductor.core.controller.BaseMapViewController
import com.mapconductor.core.features.GeoPointInterface
Expand Down Expand Up @@ -125,6 +128,18 @@ class MapplsViewController(
}
}

// Many circles too: the same raster layer path, in the circle band.
circleController.tiler =
CircleTiler().apply {
onTemplate = { template, tileSize ->
if (template != null) {
rasterLayerController.upsert(circleTileRasterLayerState(template, tileSize))
} else {
rasterLayerController.removeById(CIRCLE_TILE_LAYER_ID)
}
}
}

// Many polylines too: the same raster layer path, in the polyline band.
polylineController.tiler =
PolylineTiler().apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class MapplsCircleOverlayRenderer(

/** Reapply the current composition after a Mappls style is created or replaced. */
fun redraw() {
val circles = circleManager.allEntities()
val circles = circleManager.nativeEntities().filter { (it.circle as MapplsActualCircle?) != null }
holder.map.style?.let { style ->
coroutine.launch { layer.draw(circles, style) }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.mapconductor.mappls.raster

import com.mapconductor.core.circle.CIRCLE_TILE_LAYER_ID
import com.mapconductor.core.controller.OverlayKind
import com.mapconductor.core.polygon.POLYGON_TILE_LAYER_ID
import com.mapconductor.core.polyline.POLYLINE_TILE_LAYER_ID
Expand Down Expand Up @@ -32,6 +33,8 @@ class MapplsRasterLayerOverlayRenderer(

private fun isPolylineTileRaster(state: RasterLayerState): Boolean = state.id == POLYLINE_TILE_LAYER_ID

private fun isCircleTileRaster(state: RasterLayerState): Boolean = state.id == CIRCLE_TILE_LAYER_ID

override suspend fun onAdd(
data: List<RasterLayerOverlayRendererInterface.AddParamsInterface>,
): List<MapplsRasterLayerHandle?> =
Expand Down Expand Up @@ -120,6 +123,8 @@ class MapplsRasterLayerOverlayRenderer(
MapplsOverlayStacking.MARKER_TILE
} else if (isPolygonTileRaster(state)) {
MapplsOverlayStacking.POLYGON_TILE
} else if (isCircleTileRaster(state)) {
MapplsOverlayStacking.CIRCLE_TILE
} else if (isPolylineTileRaster(state)) {
MapplsOverlayStacking.POLYLINE_TILE
} else {
Expand Down Expand Up @@ -157,7 +162,7 @@ class MapplsRasterLayerOverlayRenderer(
val ordered =
stateById.values
.asSequence()
.filter { !isMarkerTileRaster(it) && !isPolygonTileRaster(it) && !isPolylineTileRaster(it) }
.filter { !isMarkerTileRaster(it) && !isPolygonTileRaster(it) && !isPolylineTileRaster(it) && !isCircleTileRaster(it) }
.sortedBy { it.zIndex }
.mapNotNull { state -> handleById[state.id]?.let { handle -> state to handle } }
.toList()
Expand Down
Loading