Skip to content

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

Merged
merged 5 commits into from
Aug 22, 2017

Conversation

acrosby
Copy link
Contributor

@acrosby acrosby commented Jul 20, 2017

...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.

…itional kwargs as a way to support non-standard WMS request parameters
""")


def render(self, **kwargs):

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 "

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F821 undefined name 'Figure'

@acrosby
Copy link
Contributor Author

acrosby commented Jul 25, 2017

Actually, want to smooth some issues out first.

@acrosby acrosby closed this Jul 25, 2017
@ocefpaf
Copy link
Member

ocefpaf commented Jul 25, 2017

OK. No need to close, just add a WIP in the title.

@acrosby
Copy link
Contributor Author

acrosby commented Jul 25, 2017

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.

@acrosby acrosby reopened this Jul 25, 2017
@acrosby acrosby changed the title Adding Leaflet.timeDimension support for WmsTileLayers WIP: Adding Leaflet.timeDimension support for WmsTileLayers Jul 25, 2017
@acrosby
Copy link
Contributor Author

acrosby commented Aug 18, 2017

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

@acrosby acrosby changed the title WIP: Adding Leaflet.timeDimension support for WmsTileLayers Adding Leaflet.timeDimension support for WmsTileLayers Aug 18, 2017
@@ -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

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):
Copy link
Member

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):
Copy link
Member

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.)

Copy link
Member

@ocefpaf ocefpaf left a 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.

@acrosby
Copy link
Contributor Author

acrosby commented Aug 22, 2017

Sure, I can do that--might be a few days.

@ocefpaf
Copy link
Member

ocefpaf commented Aug 22, 2017

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 😄)

@acrosby
Copy link
Contributor Author

acrosby commented Aug 22, 2017

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.

@ocefpaf
Copy link
Member

ocefpaf commented Aug 22, 2017

You should be able to do a git pull to get the rebased version here.
But yes, adding it later sounds easier.

@ocefpaf ocefpaf merged commit d9dfb85 into python-visualization:master Aug 22, 2017
sanga pushed a commit to sanga/folium that referenced this pull request Oct 24, 2017
Adding Leaflet.timeDimension support for WmsTileLayers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants