-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Leaflet-Velocity with TIME ? #21
Comments
Hi @xelaboy, I haven't personally integrated leaflet-velocity with any time controls, however I don't think it would take much. It's not mentioned in the README, but there is a public |
@danwild , Thanks much for your fast reply. |
Let me use an example. In the demo for this project, the layers represent data for a single point in time, e.g. So - the JSON file has data that represents a single time slice. If you wanted to have a time control that allows the user to select which time slice they want to look at, you just need to connect the time control to update the velocity layer with the data for the time they want to look at. The This obviously assumes you have the data for the range of time slices you want to be available to the user. |
Ok. I THINK I got what you mean! Let me try and see what I can get... |
Hello @danwild, FYI. |
@danwild Hi Dan, so how can the setData() be called. I am comfortable generally speaking with the plugin but need the syntax for setData() to apply on the Layer instance. Step 1 (setting the first time):
Step 2 (public func to update data):
I need some pointer to the step-2 update call. Thanks |
Have you tried: |
I figured out the syntax for step-2 which was simple and close. However, I am not deleting the question and this comment (only closing) in case someone else needs it. The update call on the Layer instance in my Step-2 was simple: This is very useful and well thought-through as there is no need to create additional LayerGroups and clear them and repopulate. The plugin handles it well. |
Thanks, @brentfraser. You literally beat me by a few seconds/minutes. I saw your response shortly after posting my own. Yes, that works. |
Hi, community and @brentfraser, I've another related question. While using I have tried the following, but the result is less than satisfactory. Also, this is a terrible idea to directly manipulate the factory CSS selector: This is not a critical issue but would be nice to have this feature, which is an animation of the animation with a smooth transition. Thanks |
The way I've done this for another project (weather radar animation, not wind vectors) was to create a LayerGroup, load the my five weather radar images into five Layers in the LayerGroup, use .setOpacity(0.0) on each to make all of them invisible. To "animate: the layers , I would the loop through the LayerGroup on a timer, setting the opacity to current layer to 1 and the previous to 0. The important part here is to preload all your data into separate layers, then turn them on/off in sequence without doing a load in between (that would cause a delay and the map would flicker). |
Thanks, @brentfraser. It sounds like a nice workaround but I think this may not work as |
Yes, my radar implementation used tile layers so setOpacity was available. You would need to add the function to the Velocity Layer definition (perhaps review the leaflet source code as a guide). |
This plugin is aimed at visualising vectors for a single time, so is not really suited to animate along temporal dimension (would be nice, but out of scope here). Saying that, if you do want to take an approach similar to that mentioned by brentfraser, off the top of my head I see two reasonable options for frame visibility:
|
Hi @danwild thank you for adding the Due to other reasons, however, I've not used the On a separate note, even setting opacity to 0 does not make the layer invisible: Thank you both @danwild and @brentfraser for this brainstorming and your time. Before setting |
Thanks @prasanjitdash, please see v1.6.1 |
Thank You, @danwild. It does exactly what its supposed to do now. Very useful. |
Hello.
I'm new around here and I'd like to know if it's possible to use this great plugin (Velocity) with any kind of TIME control in Leaflet maps.
Any help will be very appreciated.
Thanks much.
The text was updated successfully, but these errors were encountered: