# HG changeset patch # User Sebastien Jodogne # Date 1788279732 -7200 # Node ID 5bffc731ba4800712dad531683f7149c47ab27ec # Parent 2949bd229f0d6ed095e92a77e3c6f269c3cf0cb0 fix active layer diff -r 2949bd229f0d -r 5bffc731ba48 ViewerPlugin/WebApplication/viewer.js --- a/ViewerPlugin/WebApplication/viewer.js Tue Sep 01 18:12:18 2026 +0200 +++ b/ViewerPlugin/WebApplication/viewer.js Tue Sep 01 18:22:12 2026 +0200 @@ -23,8 +23,6 @@ var app = new Vue({ el: '#app', - computed: { - }, data() { return { @@ -111,6 +109,17 @@ }; }, + computed: { + }, + + watch: { + activeUserLayerId: function() { + if (this.activeDrawTool === 'modify') { + this.RefreshModifyFeatureCollection(); + } + } + }, + mounted: function() { this.InitializePanelAnimation(); @@ -532,12 +541,7 @@ this.DeactivateAll(); if (!wasActive) { if (toolName === 'modify') { - this.modifyFeatureCollection.clear(); - this.drawSource.getFeatures().forEach(function(feature) { - if (feature.get('layer-id') === app.activeUserLayerId) { - app.modifyFeatureCollection.push(feature); - } - }); + this.RefreshModifyFeatureCollection(); } this.map.addInteraction(interactions[toolName]); if (drawTools.indexOf(toolName) !== -1) { @@ -551,6 +555,19 @@ } }, + RefreshModifyFeatureCollection: function() { + if (this.modifyFeatureCollection !== null & + this.drawSource !== null) { + var activeLayerId = this.activeUserLayerId; + this.modifyFeatureCollection.clear(); + this.drawSource.getFeatures().forEach(function(feature) { + if (feature.get('layer-id') === activeLayerId) { + app.modifyFeatureCollection.push(feature); + } + }); + } + }, + DeleteSelectedAnnotation: function() { var selected = this.selectAnnotation.getFeatures(); if (selected.getLength() > 0) {