mobility-toolbox-js 2.0.0-beta.64 → 2.0.0-beta.65
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/mbt.js +8 -19
- package/mbt.js.map +2 -2
- package/mbt.min.js +1 -1
- package/mbt.min.js.map +2 -2
- package/ol/layers/Layer.d.ts.map +1 -1
- package/ol/layers/Layer.js +12 -16
- package/package.json +1 -1
package/mbt.js
CHANGED
|
@@ -48092,29 +48092,12 @@ uniform ${i3} ${o3} u_${a3};
|
|
|
48092
48092
|
var Layer3 = class extends UserInteractionsLayerMixin_default(Layer2) {
|
|
48093
48093
|
constructor(options) {
|
|
48094
48094
|
super(options);
|
|
48095
|
-
|
|
48096
|
-
this.olLayer.setVisible(this.visible);
|
|
48097
|
-
}
|
|
48095
|
+
this.olLayer?.setVisible(this.visible);
|
|
48098
48096
|
}
|
|
48099
48097
|
defineProperties(options) {
|
|
48100
48098
|
super.defineProperties(options);
|
|
48101
|
-
let currOlLayer = options.olLayer;
|
|
48102
48099
|
Object.defineProperties(this, {
|
|
48103
|
-
olLayer: {
|
|
48104
|
-
get: () => {
|
|
48105
|
-
return currOlLayer;
|
|
48106
|
-
},
|
|
48107
|
-
set: (newOlLayer) => {
|
|
48108
|
-
if (currOlLayer === newOlLayer) {
|
|
48109
|
-
return;
|
|
48110
|
-
}
|
|
48111
|
-
currOlLayer = newOlLayer;
|
|
48112
|
-
if (currOlLayer) {
|
|
48113
|
-
currOlLayer.setVisible(this.visible);
|
|
48114
|
-
}
|
|
48115
|
-
this.toggleVisibleListeners();
|
|
48116
|
-
}
|
|
48117
|
-
},
|
|
48100
|
+
olLayer: { value: options.olLayer, writable: true },
|
|
48118
48101
|
olListenersKeys: {
|
|
48119
48102
|
value: []
|
|
48120
48103
|
}
|
|
@@ -48129,12 +48112,18 @@ uniform ${i3} ${o3} u_${a3};
|
|
|
48129
48112
|
if (this.olLayer && !this.map?.getLayers()?.getArray()?.includes(this.olLayer)) {
|
|
48130
48113
|
this.map.addLayer(this.olLayer);
|
|
48131
48114
|
}
|
|
48115
|
+
this.olListenersKeys.push(this.on("change:visible", () => {
|
|
48116
|
+
if (this.olLayer) {
|
|
48117
|
+
this.olLayer.setVisible(this.visible);
|
|
48118
|
+
}
|
|
48119
|
+
}));
|
|
48132
48120
|
this.olListenersKeys.push(this.map.getLayers().on("remove", (evt) => {
|
|
48133
48121
|
if (evt.element === this.olLayer) {
|
|
48134
48122
|
this.detachFromMap();
|
|
48135
48123
|
}
|
|
48136
48124
|
}));
|
|
48137
48125
|
this.toggleVisibleListeners();
|
|
48126
|
+
this.olListenersKeys.push(this.on("change:visible", this.toggleVisibleListeners));
|
|
48138
48127
|
if (this.copyrights && this.olLayer) {
|
|
48139
48128
|
const attributions = this.copyrights || [];
|
|
48140
48129
|
if (this.olLayer.getLayers) {
|