diff --git a/Sources/MapConductorForHERE/HereMapHost.swift b/Sources/MapConductorForHERE/HereMapHost.swift index f2ef77a..9427b71 100644 --- a/Sources/MapConductorForHERE/HereMapHost.swift +++ b/Sources/MapConductorForHERE/HereMapHost.swift @@ -97,6 +97,17 @@ public final class HereMapHost: MapViewCoordinatorBase, Marker } } 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 // Route the simple overlays through the shared collector so each // controller subscribes to one source of truth instead of the map @@ -251,6 +262,8 @@ public final class HereMapHost: MapViewCoordinatorBase, Marker 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/MapConductorForHERE/marker/HereMarkerController.swift b/Sources/MapConductorForHERE/marker/HereMarkerController.swift index 9ae7712..c097f26 100644 --- a/Sources/MapConductorForHERE/marker/HereMarkerController.swift +++ b/Sources/MapConductorForHERE/marker/HereMarkerController.swift @@ -129,6 +129,7 @@ final class HereMarkerController: AbstractMarkerController