13 lines
405 B
TypeScript
13 lines
405 B
TypeScript
import type { Map as MapLibreMap } from "maplibre-gl";
|
|
import { simulationLayerIds } from "./annotation-layers";
|
|
|
|
export function setSimulationLayersVisibility(map: MapLibreMap, visible: boolean) {
|
|
const visibility = visible ? "visible" : "none";
|
|
|
|
simulationLayerIds.forEach((layerId) => {
|
|
if (map.getLayer(layerId)) {
|
|
map.setLayoutProperty(layerId, "visibility", visibility);
|
|
}
|
|
});
|
|
}
|