WMSTileLayer in react-leaflet doesn't update layer on map when parameters of geo-server layer are changed

Viewed 141

I want to reload wms layer when there is a change in parameters but seems once map container is loaded on start of application, it doesn't reload Map when there is a change in WMSTileLayer

<MapContainer

 <TileLayer attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
 url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"/>
>
<WMSTileLayer 
           
           url="http://localhost:8080/geoserver/PropsureWndb/wms?"
           version="2.20.1"
           opacity={1}
           transparent
           layers={"PropsureWndb:sqlrouteviews"}
           srs="EPSG:4326"
           viewparams= {`lat:${lat};long:${long};lat1:${lat1};long1:${long1}`}
           format="image/png"
          />
</MapContainer>
1 Answers

That is as expected a WMTS layer is designed to speed up map drawing by being cached in the browser. If your layer changes often then you should use a WMS layer which will be redrawn each time the map moves.

Related