Leaflet.TimeDimension icon indicating copy to clipboard operation
Leaflet.TimeDimension copied to clipboard

Not able to make time dimension work with a non WMS layer

Open Rishabh570 opened this issue 4 years ago • 2 comments

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.

Rishabh570 avatar Mar 30 '20 11:03 Rishabh570

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:

bielfrontera avatar Mar 30 '20 12:03 bielfrontera

Thanks for the pointers. :+1:

Rishabh570 avatar Mar 31 '20 08:03 Rishabh570