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 @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
Expand Down
Loading