How to make the wind layer open automatically #12
-
In your example, the wind layer needs to be opened by selecting the checkbox. Is there any way to open it automatically? I know this is a low-level question, but I really don't know how to implement this feature. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, Firstly - I strongly suggest you consider using the leaflet-velocity plugin, which is much more flexible and better supported (your use-case is a good example - the So, secondly (for a // make a map
const map = L.map('map');
// make a layer
var velocityLayer = L.velocityLayer(myParams);
// add layer to map
velocityLayer.addTo(map); |
Beta Was this translation helpful? Give feedback.
Hi,
Firstly - I strongly suggest you consider using the leaflet-velocity plugin, which is much more flexible and better supported (your use-case is a good example - the
leaflet-velocity
layer has the benefit of being added/removed from map in the same way as any other leaflet layer).So, secondly (for a
leaflet-velocity
layer) - you simply need to add the layer to the map, e.g.