From 039f4eb46f037f89c05c1e5235f451f839ae5e12 Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Sat, 7 Nov 2026 22:35:34 -0800 Subject: [PATCH] Clear ground images and raster layers in clearOverlays() too clearOverlays() cleared markers, polylines, polygons and circles but not the ground image controller, and nothing removed the raster layers, so both stayed on the map (seen on the tablet: the relief raster still covered the map after clearOverlays()). It is the same kind of gap as the Mapbox circles fixed in "Clear circles in clearOverlays() too". TomTom has no RasterLayerController (rasters are folded into the composed style), so the equivalent of rasterLayerController.clear() is done here: the layers added through the public RasterLayer overlay (publicRasterLayerIds) are removed. Rasters mounted from outside the content, such as marker tiles, are left to their owners. --- .../com/mapconductor/tomtom/TomTomMapViewController.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/mapconductor/tomtom/TomTomMapViewController.kt b/src/main/java/com/mapconductor/tomtom/TomTomMapViewController.kt index e8dd877..00232d1 100644 --- a/src/main/java/com/mapconductor/tomtom/TomTomMapViewController.kt +++ b/src/main/java/com/mapconductor/tomtom/TomTomMapViewController.kt @@ -211,6 +211,13 @@ class TomTomMapViewController internal constructor( polylineController.clear() polygonController.clear() circleController.clear() + groundImageController.clear() + // TomTom には RasterLayerController が無い(ラスタは合成スタイルへ畳み込む)ので、 + // 他プロバイダの rasterLayerController.clear() に当たるものをここで行う。消すのは + // 公開 RasterLayer 経由のものだけ。マーカータイル等の mount 分は持ち主が外す。 + val rasterIds = publicRasterLayerIds.toList() + publicRasterLayerIds.clear() + rasterIds.forEach { removeRasterLayer(it) } } override fun setMarkerAnimationOverlayHost(host: MarkerAnimationOverlayHost?) {