mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
On Map Point delete: Make Polyline Layer visible, if it was before
This commit is contained in:
parent
c159b56e25
commit
a5bd75b27d
1 changed files with 11 additions and 5 deletions
|
|
@ -382,10 +382,14 @@ export default class extends Controller {
|
||||||
.then(data => {
|
.then(data => {
|
||||||
// Remove the marker and update all layers
|
// Remove the marker and update all layers
|
||||||
this.removeMarker(id);
|
this.removeMarker(id);
|
||||||
|
let wasPolyLayerVisible = false;
|
||||||
// Explicitly remove old polylines layer from map
|
// Explicitly remove old polylines layer from map
|
||||||
if (this.polylinesLayer) {
|
if (this.polylinesLayer) {
|
||||||
|
if (this.map.hasLayer(this.polylinesLayer)) {
|
||||||
|
wasPolyLayerVisible = true;
|
||||||
|
}
|
||||||
this.map.removeLayer(this.polylinesLayer);
|
this.map.removeLayer(this.polylinesLayer);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create new polylines layer
|
// Create new polylines layer
|
||||||
|
|
@ -397,10 +401,12 @@ export default class extends Controller {
|
||||||
this.userSettings,
|
this.userSettings,
|
||||||
this.distanceUnit
|
this.distanceUnit
|
||||||
);
|
);
|
||||||
|
if (wasPolyLayerVisible) {
|
||||||
// Add new polylines layer to map and to layer control
|
// Add new polylines layer to map and to layer control
|
||||||
this.polylinesLayer.addTo(this.map);
|
this.polylinesLayer.addTo(this.map);
|
||||||
|
} else {
|
||||||
|
this.map.removeLayer(this.polylinesLayer);
|
||||||
|
}
|
||||||
// Update the layer control
|
// Update the layer control
|
||||||
if (this.layerControl) {
|
if (this.layerControl) {
|
||||||
this.map.removeControl(this.layerControl);
|
this.map.removeControl(this.layerControl);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue