-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Adding Leaflet.timeDimension support for WmsTileLayers #644
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
Conversation
…itional kwargs as a way to support non-standard WMS request parameters
""") | ||
|
||
|
||
def render(self, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E303 too many blank lines (2)
super(TimestampedWmsTileLayer, self).render() | ||
|
||
figure = self.get_root() | ||
assert isinstance(figure, Figure), ("You cannot render this Element " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F821 undefined name 'Figure'
Actually, want to smooth some issues out first. |
OK. No need to close, just add a |
Alright. I noticed that if the time units are not specified in the layers GetCapabilities, then the time control doesn't get populated with the available times, so I want to expose some additional arguments that will allow that to get set manually. |
This should get the job done to support datasets that might have a problem with their time units in the GetCaps, also supports multiple time enabled wms layers using a single control |
@@ -17,6 +17,7 @@ | |||
from .scroll_zoom_toggler import ScrollZoomToggler | |||
from .terminator import Terminator | |||
from .timestamped_geo_json import TimestampedGeoJson | |||
from .timestamped_wmstilelayer import TimestampedWmsTileLayers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F401 '.timestamped_wmstilelayer.TimestampedWmsTileLayers' imported but unused
|
||
For more information see: | ||
http://leafletjs.com/reference.html#tilelayer-wms | ||
|
||
""" | ||
def __init__(self, url, name=None, layers=None, styles=None, fmt=None, | ||
transparent=True, version='1.1.1', attr=None, overlay=True, | ||
control=True): | ||
control=True, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 ideally we should validade those kw args before passing to the render b/c they fail silently. But that can be done in another PR. Let us assume that people adding extra options know what they are doing.
|
||
class TimestampedWmsTileLayers(Layer): | ||
def __init__(self, data, transition_time=200, loop=False, auto_play=False, | ||
period="P1D", time_interval=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In folium we prefer single quotes '
instead of double "
to make it clear to ready JSON and Python. (JSON are only double.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test and an entry to the changelog?
If the test is too much now we can merge it with a use example instead and I'll add a test later.
Sure, I can do that--might be a few days. |
Maybe let us go for the "example only" then and I can merge this and open an issue for the rest. I only have today for "folium work" and I would like to advance as much as possible. (No pressure though I have tons of other PRs and issues here 😄) |
Sure, I was using a notebook to test my changes anyway. I'll just find a public WMS server to point to, and fix the quotes style thing too. |
You should be able to do a |
Adding Leaflet.timeDimension support for WmsTileLayers
...as well as additional kwargs as a way to support non-standard WMS request parameters in WmsTileLayers. Couldn't come up with a good way to setup a test, open to suggestions.