+
+ Do you want to delete the layer {selectedDeleteLayer?.name}? This action
+ cannot be undone.
+
+
+ );
+ }
if (isLayerControlVisible) {
return (
@@ -281,20 +335,7 @@ const LayerControlPanel = memo(({ maplibreRef, setLayers, layers }: Props) => {
: LAYER_PANEL_SHOW_LAYER_ICON
}
size="s"
- onClick={() => {
- if (layer.visibility === LAYER_VISIBILITY.VISIBLE) {
- layer.visibility = LAYER_VISIBILITY.NONE;
- setLayerVisibility(
- new Map(layerVisibility.set(layer.id, false))
- );
- } else {
- layer.visibility = LAYER_VISIBILITY.VISIBLE;
- setLayerVisibility(
- new Map(layerVisibility.set(layer.id, true))
- );
- }
- layersFunctionMap[layer.type]?.hide(maplibreRef, layer);
- }}
+ onClick={() => onLayerVisibilityChange(layer)}
aria-label="Hide or show layer"
color="text"
/>
@@ -306,10 +347,7 @@ const LayerControlPanel = memo(({ maplibreRef, setLayers, layers }: Props) => {