Vue2Leaflet icon indicating copy to clipboard operation
Vue2Leaflet copied to clipboard

Changing LWMSTileLayer `layers` prop has no effect

Open guygriffiths opened this issue 4 years ago • 4 comments

Description

Changing the LWMSTileLayer layers prop does not trigger redraw.

Live Demo

http://jsfiddle.net/q1gfj9n7/4/

Steps to Reproduce

As per fiddle, any LWMSTileLayer which has a layers property which changes will not redraw the layer.

Expected Results

Changing the value of layers should cause the layer to be redrawn using the new layer name.

Actual Results

Nothing visible changes.

Browsers Affected

  • [X] Chrome
  • [X] Firefox

Unable to check:

  • [ ] Edge
  • [ ] Safari 9
  • [ ] Safari 8
  • [ ] IE 11

Versions

  • Leaflet: v1.6.0
  • Vue: v2.6.10
  • Vue2Leaflet: v2.5.2

guygriffiths avatar Apr 15 '20 13:04 guygriffiths

@guygriffiths Thank you for the issue! Confirmed the bug, will investigate

DonNicoJs avatar Apr 26 '20 15:04 DonNicoJs

the same question,when I update a new attribute value it can't send a new request

evaseemefly avatar Aug 11 '20 12:08 evaseemefly

Same problem, does anybody know a solution?

dirk-ecker avatar Jul 28 '21 10:07 dirk-ecker

A workaround: Put a ref to your layer and update the layers parameter.

this.$refs.wmsTileLayer.mapObject.wmsParams.layers

dirk-ecker avatar Jul 28 '21 11:07 dirk-ecker