maplibre-gl-layer-control 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +5 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -642,8 +642,8 @@ class LayerControl {
|
|
|
642
642
|
*/
|
|
643
643
|
isDrawnLayer(layerId) {
|
|
644
644
|
const drawnLayerPatterns = [
|
|
645
|
-
/^gm[-_]/i,
|
|
646
|
-
// Geoman (gm-main-*, gm_
|
|
645
|
+
/^gm[-_\s]/i,
|
|
646
|
+
// Geoman (gm-main-*, gm_*, Gm Temporary...)
|
|
647
647
|
/^gl-draw[-_]/i,
|
|
648
648
|
// Mapbox GL Draw
|
|
649
649
|
/^mapbox-gl-draw[-_]/i,
|
|
@@ -1353,6 +1353,9 @@ class LayerControl {
|
|
|
1353
1353
|
const styleLayers = this.map.getStyle().layers || [];
|
|
1354
1354
|
styleLayers.forEach((layer) => {
|
|
1355
1355
|
if (!this.isUserAddedLayer(layer.id)) {
|
|
1356
|
+
if (this.excludeDrawnLayers && this.isDrawnLayer(layer.id)) {
|
|
1357
|
+
return;
|
|
1358
|
+
}
|
|
1356
1359
|
if (this.state.onlyRenderedFilter && !this.isLayerRendered(layer.id)) {
|
|
1357
1360
|
return;
|
|
1358
1361
|
}
|