socib / Leaflet.TimeDimension

Add time dimension capabilities on a Leaflet map.
MIT License
433 stars 138 forks source link

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

Open Rishabh570 opened 4 years ago

Rishabh570 commented 4 years ago

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.

bielfrontera commented 4 years ago

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:

Rishabh570 commented 4 years ago

Thanks for the pointers. :+1: