maplibre-gl-layer-control-tidop 0.0.4 → 0.0.6
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 +2 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +2 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -928,8 +928,7 @@ class LayerControl {
|
|
|
928
928
|
const isVisible = visibility !== "none";
|
|
929
929
|
const layerType = layer.type;
|
|
930
930
|
const opacity = getLayerOpacity(this.map, layerId, layerType);
|
|
931
|
-
|
|
932
|
-
const friendlyName = this.map.getLayoutProperty(layerId, "title");
|
|
931
|
+
const friendlyName = this.generateFriendlyName(layerId);
|
|
933
932
|
this.state.layerStates[layerId] = {
|
|
934
933
|
visible: isVisible,
|
|
935
934
|
opacity,
|
|
@@ -965,7 +964,6 @@ class LayerControl {
|
|
|
965
964
|
const layerType = layer.type;
|
|
966
965
|
const opacity = getLayerOpacity(this.map, layerId, layerType);
|
|
967
966
|
const friendlyName = this.generateFriendlyName(layerId);
|
|
968
|
-
console.log(layer);
|
|
969
967
|
this.state.layerStates[layerId] = {
|
|
970
968
|
visible: isVisible,
|
|
971
969
|
opacity,
|
|
@@ -1089,7 +1087,7 @@ class LayerControl {
|
|
|
1089
1087
|
let name = layerId.replace(/^(layer[-_]?|gl[-_]?)/, "");
|
|
1090
1088
|
name = name.replace(/[-_]/g, " ");
|
|
1091
1089
|
name = name.replace(/\b\w/g, (char) => char.toUpperCase());
|
|
1092
|
-
return
|
|
1090
|
+
return layerId;
|
|
1093
1091
|
}
|
|
1094
1092
|
/**
|
|
1095
1093
|
* Check if a layer ID belongs to a drawing library (Geoman, Mapbox GL Draw, etc.)
|