From 1979faf669faebcd891b817300c5af8f3b25a4de Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Sat, 7 Nov 2026 07:41:29 -0800 Subject: [PATCH 1/2] Call onAdded for markers Natively drawn markers are reported by MarkerIngestionEngine once the renderer has created them; markers that went into the tiles are reported after the tile layer has been handed to the map. --- .../MapConductorForMapKit/marker/MapKitMarkerController.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/MapConductorForMapKit/marker/MapKitMarkerController.swift b/Sources/MapConductorForMapKit/marker/MapKitMarkerController.swift index 9995443..43b8620 100644 --- a/Sources/MapConductorForMapKit/marker/MapKitMarkerController.swift +++ b/Sources/MapConductorForMapKit/marker/MapKitMarkerController.swift @@ -195,6 +195,7 @@ final class MapKitMarkerController: AbstractMarkerController Date: Mon, 9 Nov 2026 10:35:33 -0800 Subject: [PATCH 2/2] Draw many polylines as raster tiles Give the polyline controller a PolylineTiler whose template is upserted as the "mc-polyline-tiles" raster layer (removed by id when nothing is tiled), as the polygon tiles are. The content's polylineTilingOptions reach the tiler on every content update; a change re-routes the current list. The tile layer stacks at the bottom of the polyline band (OverlayStacking.rasterKey). --- Sources/MapConductorForMapKit/MapKitMapView.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Sources/MapConductorForMapKit/MapKitMapView.swift b/Sources/MapConductorForMapKit/MapKitMapView.swift index 669b0b7..3d15c00 100644 --- a/Sources/MapConductorForMapKit/MapKitMapView.swift +++ b/Sources/MapConductorForMapKit/MapKitMapView.swift @@ -280,6 +280,17 @@ private struct MapKitMapViewRepresentable: UIViewRepresentable { } } polygonController.tiler = polygonTiler + // Many polylines likewise, in their own raster layer in the polyline band + // (under the natively drawn polylines); taps still resolve against the original lines. + let polylineTiler = PolylineTiler() + polylineTiler.onTemplate = { [weak rasterLayerController] template, tileSize in + if let template { + await rasterLayerController?.upsert(state: PolylineTiler.rasterLayerState(template: template, tileSize: tileSize)) + } else { + await rasterLayerController?.removeById(PolylineTiler.layerId) + } + } + polylineController.tiler = polylineTiler let groundImageController = MapKitGroundImageController(mapView: mapView) self.groundImageController = groundImageController @@ -394,6 +405,8 @@ private struct MapKitMapViewRepresentable: UIViewRepresentable { overlayScope?.polylineCollector.sync(content.polylines.map { $0.state }) overlayScope?.polygonCollector.sync(content.polygons.map { $0.state }) polygonController?.tiler?.refreshIfServerMoved() + if polylineController?.tiler?.setOptions(content.polylineTilingOptions) == true { overlayScope?.polylineCollector.flush() } + polylineController?.tiler?.refreshIfServerMoved() for handler in content.polygonSyncHandlers { let hullController = hullPolygonController handler.bindPolygonSync { [weak hullController] states in