Skip to content

Commit

Permalink
Adapt LayerList according to added / removed layers in map
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismayer committed Jun 27, 2018
1 parent fadbf77 commit 92757b9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/layerlist/LayerList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@
* This function is executed, after the map is bound (see mixins/Mapable)
*/
onMapBound () {
this.createLayerItems();
var me = this;
me.createLayerItems();
// react on added / removed layers
me.map.getLayers().on('change:length', function (evt) {
me.createLayerItems();
});
},
/**
* Creates the layer items from the OpenLayers map.
Expand Down

0 comments on commit 92757b9

Please sign in to comment.