removeGeometry method
Removes a geometry layer and its corresponding source.
Implementation
Future<void> removeGeometry(String sourceId) async {
try {
final layers = _sourceLayers[sourceId] ?? [];
for (final layerId in layers) {
await mapController.removeLayer(layerId);
}
await mapController.removeSource(sourceId);
_geoJsonCache.remove(sourceId);
_sourceLayers.remove(sourceId);
} catch (e) {
// Ignore if doesn't exist
}
}