Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions folium/raster_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def __init__(
super().__init__(name=name, overlay=overlay, control=control, show=show)
self.url = url
kwargs["format"] = fmt
cql_filter = kwargs.pop("cql_filter", None)
self.options = parse_options(
layers=layers,
styles=styles,
Expand All @@ -222,6 +223,9 @@ def __init__(
attribution=attr,
**kwargs
)
if cql_filter:
# special parameter that shouldn't be camelized
self.options["cql_filter"] = cql_filter
Comment on lines +226 to +228
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we pop it from the kw args to avoid adding an extra arg entry? Not sure if this is best but maybe something like:

cql_filter = kwargs.pop("cql_filter", None)
if cql_filter:
    # special parameter that shouldn't be camelized
    self.options["cql_filter"] = cql_filter



class ImageOverlay(Layer):
Expand Down
7 changes: 6 additions & 1 deletion tests/test_raster_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,14 @@ def test_wms():
layers="nexrad-n0r-900913",
attr="Weather data © 2012 IEM Nexrad",
transparent=True,
cql_filter="something",
)
w.add_to(m)
m._repr_html_()
html = m.get_root().render()

# verify this special case wasn't converted to lowerCamelCase
assert '"cql_filter": "something",' in html
assert "cqlFilter" not in html

bounds = m.get_bounds()
assert bounds == [[None, None], [None, None]], bounds
Expand Down