Leaflet.TimeDimension
Leaflet.TimeDimension copied to clipboard
Not able to make time dimension work with a non WMS layer
I'm using this plugin to add time dimension capabilities to an already established project. I'm converting the (non-WMS) layers to the time dimension ones with the syntax,
L.timeDimension.layer.wms(layer).addTo(map);
But the slider says Time not available
and _availableTimes
array is empty when I logged the layer info. Does this mean that non-WMS layers cannot be converted to what is demonstrated in example1.
(BTW when I use L.timeDimension.layer(layer).addTo(map), it's not even showing the overlay on the map...so that's also not working).
@bielfrontera Would appreciate your suggestions.
You can only use L.TimeDimension.Layer.WMS
with L.TileLayer.WMS
or L.NonTiledLayer.WMS
layers.
But you can use TimeDimension which any kind of layer if you implement a new class that extends L.TimeDimension.Layer
as described in the README.
Here you will find some code that do this:
- examples 10 and 12
- issue #19
- timedimension choropleth (issue #183)
Thanks for the pointers. :+1: