You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thanks for writing such a convenient library!
I want to recommend changing the url prop of a WMSTileLayer to be dynamic - currently, the layer won't update the url used to fetch the WMS layer, causing the new params to be sent to the wrong tile URL.
Unless I'm mistaken, the ability to change the URL dynamically would allow for declaratively rendering a map or set of maps without having to use the Leaflet Controls or having to resort to the imperative Leaflet API for adding and removing layers. Here's a potential implementation: #196 (comment)
In addition, in the interest of staying in alignment with React's declarative nature (though this contradicts the library's purpose of only "supporting features provided by Leaflet"), within componentWillUpdate, it would make sense to clear from the layer's params any params that do not exist in the newly received props before setting the params to the new props (of course, assuming they are distinct), along the lines of the solution provided here: Leaflet/Leaflet#3441 (comment)
Let me know what you think (more about the first recommendation than the second, though I think they both would be useful and are more intuitive than current behavior).
The text was updated successfully, but these errors were encountered:
Yes, good idea. I added support for dynamic url prop in v1.0.0-rc.3.
Regarding the issue with unsetting other parameters, I think that should be handled by Leaflet directly so I'd rather not implement custom logic here. If you need to clear the layer you can always give it a different key.
Please make sure to check the following boxes before submitting an issue. Thanks!
First, thanks for writing such a convenient library!
I want to recommend changing the
url
prop of aWMSTileLayer
to be dynamic - currently, the layer won't update the url used to fetch the WMS layer, causing the new params to be sent to the wrong tile URL.Unless I'm mistaken, the ability to change the URL dynamically would allow for declaratively rendering a map or set of maps without having to use the Leaflet Controls or having to resort to the imperative Leaflet API for adding and removing layers. Here's a potential implementation: #196 (comment)
In addition, in the interest of staying in alignment with React's declarative nature (though this contradicts the library's purpose of only "supporting features provided by Leaflet"), within
componentWillUpdate
, it would make sense to clear from the layer's params any params that do not exist in the newly received props before setting the params to the new props (of course, assuming they are distinct), along the lines of the solution provided here: Leaflet/Leaflet#3441 (comment)Let me know what you think (more about the first recommendation than the second, though I think they both would be useful and are more intuitive than current behavior).
The text was updated successfully, but these errors were encountered: