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 @@ -75,6 +75,7 @@ class OpenMobileMapsLayers {
private val rasterBand = Band(RASTER_INDEX_FIRST, GROUND_IMAGE_INDEX_FIRST)
private val groundImageBand = Band(GROUND_IMAGE_INDEX_FIRST, POLYGON_TILE_INDEX_FIRST)
private val polygonTileBand = Band(POLYGON_TILE_INDEX_FIRST, FIXED_INDEX_FIRST)
private val circleTileBand = Band(FIXED_INDEX_FIRST + 2, FIXED_INDEX_FIRST + 6)
private val polylineTileBand = Band(POLYLINE_TILE_INDEX_FIRST, POLYLINE_INDEX)
private val markerTileBand = Band(MARKER_TILE_INDEX_FIRST, ICON_INDEX)
private val bandOfLayer = mutableMapOf<LayerInterface, Band>()
Expand All @@ -83,8 +84,8 @@ class OpenMobileMapsLayers {
listOf(
polygonFillLayer.asLayerInterface() to FIXED_INDEX_FIRST,
polygonOutlineLayer.asLayerInterface() to FIXED_INDEX_FIRST + 1,
circleFillLayer.asLayerInterface() to FIXED_INDEX_FIRST + 2,
circleOutlineLayer.asLayerInterface() to FIXED_INDEX_FIRST + 3,
circleFillLayer.asLayerInterface() to FIXED_INDEX_FIRST + 6,
circleOutlineLayer.asLayerInterface() to FIXED_INDEX_FIRST + 7,
polylineLayer.asLayerInterface() to POLYLINE_INDEX,
iconLayer.asLayerInterface() to ICON_INDEX,
)
Expand Down Expand Up @@ -148,6 +149,9 @@ class OpenMobileMapsLayers {
): LayerInterface = insertInBand(map, layer, polygonTileBand)

/** ポリラインのタイル: ポリラインの帯の一番下(サークルの上、ネイティブのポリラインの下)。 */
fun insertCircleTile(map: MapInterface, layer: LayerInterface): LayerInterface =
insertInBand(map, layer, circleTileBand)

fun insertPolylineTile(
map: MapInterface,
layer: LayerInterface,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.mapconductor.openmobilemaps

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.controller.BaseMapViewController
import com.mapconductor.core.features.GeoPoint
import com.mapconductor.core.features.GeoPointInterface
Expand Down Expand Up @@ -195,6 +198,16 @@ class OpenMobileMapsMapViewController(
}
}
}
circleController.tiler =
CircleTiler().apply {
onTemplate = { template, tileSize ->
if (template != null) {
rasterLayerController.upsert(circleTileRasterLayerState(template, tileSize))
} else {
rasterLayerController.removeById(CIRCLE_TILE_LAYER_ID)
}
}
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import com.mapconductor.core.marker.MarkerManager
import com.mapconductor.core.marker.MarkerOverlayRendererInterface
import com.mapconductor.core.polygon.AbstractPolygonOverlayRenderer
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.polygon.PolygonController
import com.mapconductor.core.polygon.PolygonEntityInterface
Expand Down Expand Up @@ -553,7 +554,8 @@ class OpenMobileMapsCircleOverlayRenderer(
override suspend fun removeCircle(entity: CircleEntityInterface<OpenMobileMapsActualCircle>) = Unit

override suspend fun onPostProcess() {
val entities = circleManager.allEntities().sortedBy { it.state.zIndex ?: 0 }
// Tiled circles have no native fill or outline handle.
val entities = circleManager.nativeEntities().sortedBy { it.state.zIndex ?: 0 }
fillLayer.setPolygons(entities.flatMapTo(ArrayList()) { it.circle.fills }, RENDER_ORIGIN)
outlineLayer.setLines(entities.flatMapTo(ArrayList()) { it.circle.outlines })
}
Expand Down Expand Up @@ -715,6 +717,8 @@ class OpenMobileMapsRasterLayerOverlayRenderer(
} else if (state.id == POLYGON_TILE_LAYER_ID) {
// ポリゴンのタイルはポリゴンの帯の一番下(画像になったポリゴンであって、地図の画像ではない)。
layers.insertPolygonTile(holder.map, layer.asLayerInterface())
} else if (state.id == CIRCLE_TILE_LAYER_ID) {
layers.insertCircleTile(holder.map, layer.asLayerInterface())
} else if (state.id == POLYLINE_TILE_LAYER_ID) {
// ポリラインのタイルはポリラインの帯の一番下(サークルの上、ネイティブのポリラインの下)。
layers.insertPolylineTile(holder.map, layer.asLayerInterface())
Expand Down
Loading