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.cjs
CHANGED
|
@@ -644,8 +644,8 @@ class LayerControl {
|
|
|
644
644
|
*/
|
|
645
645
|
isDrawnLayer(layerId) {
|
|
646
646
|
const drawnLayerPatterns = [
|
|
647
|
-
/^gm[-_]/i,
|
|
648
|
-
// Geoman (gm-main-*, gm_
|
|
647
|
+
/^gm[-_\s]/i,
|
|
648
|
+
// Geoman (gm-main-*, gm_*, Gm Temporary...)
|
|
649
649
|
/^gl-draw[-_]/i,
|
|
650
650
|
// Mapbox GL Draw
|
|
651
651
|
/^mapbox-gl-draw[-_]/i,
|
|
@@ -1355,6 +1355,9 @@ class LayerControl {
|
|
|
1355
1355
|
const styleLayers = this.map.getStyle().layers || [];
|
|
1356
1356
|
styleLayers.forEach((layer) => {
|
|
1357
1357
|
if (!this.isUserAddedLayer(layer.id)) {
|
|
1358
|
+
if (this.excludeDrawnLayers && this.isDrawnLayer(layer.id)) {
|
|
1359
|
+
return;
|
|
1360
|
+
}
|
|
1358
1361
|
if (this.state.onlyRenderedFilter && !this.isLayerRendered(layer.id)) {
|
|
1359
1362
|
return;
|
|
1360
1363
|
}
|