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 diff --git a/Sources/MapConductorForMapKit/marker/MapKitMarkerController.swift b/Sources/MapConductorForMapKit/marker/MapKitMarkerController.swift index ba3fc19..9b19818 100644 --- a/Sources/MapConductorForMapKit/marker/MapKitMarkerController.swift +++ b/Sources/MapConductorForMapKit/marker/MapKitMarkerController.swift @@ -201,6 +201,7 @@ final class MapKitMarkerController: AbstractMarkerController