Use the same pane for all vector shapes, to allow clicks
This commit is contained in:
parent
65b9f1fe3d
commit
a4d4491d5f
@ -202,6 +202,8 @@ export default defineComponent({
|
|||||||
// markerZoomAnimation: false,
|
// markerZoomAnimation: false,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
this.leaflet.createPane('vectors');
|
||||||
|
|
||||||
this.leaflet.addControl(new LoadingControl({
|
this.leaflet.addControl(new LoadingControl({
|
||||||
position: 'topleft',
|
position: 'topleft',
|
||||||
delayIndicator: 500,
|
delayIndicator: 500,
|
||||||
|
@ -48,12 +48,10 @@ export default class DynmapLayerGroup extends LayerGroup {
|
|||||||
|
|
||||||
this._map = map;
|
this._map = map;
|
||||||
this._markerPane = map.createPane(`${this.options.id}-markers`);
|
this._markerPane = map.createPane(`${this.options.id}-markers`);
|
||||||
this._vectorPane = map.createPane(`${this.options.id}-vectors`);
|
|
||||||
|
|
||||||
this._markerPane.classList.toggle('leaflet-pane--show-labels', this.options.showLabels);
|
this._markerPane.classList.toggle('leaflet-pane--show-labels', this.options.showLabels);
|
||||||
|
|
||||||
this._markerPane.style.zIndex = (401 + this.options.priority).toString();
|
this._markerPane.style.zIndex = (401 + this.options.priority).toString();
|
||||||
this._vectorPane.style.zIndex = (400 + this.options.priority).toString();
|
|
||||||
|
|
||||||
this._updateLayerVisibility(true);
|
this._updateLayerVisibility(true);
|
||||||
|
|
||||||
@ -80,7 +78,7 @@ export default class DynmapLayerGroup extends LayerGroup {
|
|||||||
if (layer instanceof Marker) {
|
if (layer instanceof Marker) {
|
||||||
layer.options.pane = `${this.options.id}-markers`;
|
layer.options.pane = `${this.options.id}-markers`;
|
||||||
} else if (layer instanceof Path) {
|
} else if (layer instanceof Path) {
|
||||||
layer.options.pane = `${this.options.id}-vectors`;
|
layer.options.pane = `vectors`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const zoomLimited = this._isLayerZoomLimited(layer);
|
const zoomLimited = this._isLayerZoomLimited(layer);
|
||||||
@ -127,7 +125,6 @@ export default class DynmapLayerGroup extends LayerGroup {
|
|||||||
|
|
||||||
if(this._markerPane) {
|
if(this._markerPane) {
|
||||||
this._markerPane.style.zIndex = (401 + this.options.priority).toString();
|
this._markerPane.style.zIndex = (401 + this.options.priority).toString();
|
||||||
this._vectorPane!.style.zIndex = (400 + this.options.priority).toString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user