Toggle or Show parameter for choropleth layers not working as expected
See original GitHub issue#
### Please add a code sample or a nbviewer link, copy-pastable if possible
m.choropleth(name = 'Registered Electric Vehicles',geo_data = zips, data = zips, key_on='feature.properties.ZIP',
columns=['ZIP','EV'], fill_color='BuGn', line_weight = 0.3, line_opacity = 0.5,
fill_opacity = 0.5, legend_name = 'Registered Electric Vehicles',
smooth_factor = 1, toggle = True)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-54-828389e26172> in <module>()
11 columns=['ZIP','PHEV'], fill_color='RdPu', line_weight = 0.3, line_opacity = 0.5,
12 fill_opacity = 0.5, legend_name = 'Registered Plug-in Hybrids',
---> 13 smooth_factor = 1, toggle = True)
14 m.choropleth(name = 'Registered Electric Vehicles',geo_data = zips, data = zips, key_on='feature.properties.ZIP',
15 columns=['ZIP','EV'], fill_color='BuGn', line_weight = 0.3, line_opacity = 0.5,
TypeError: choropleth() got an unexpected keyword argument 'toggle'
Problem description
I have a map with multiple choropleth layers that I want available to select in LayerControl, but I only want one to display on load.
Based on #772 and #606 it seems like anything inheriting the Layer
class should have the parameter toggle
to enable or disable the layer on load. This doesn’t work for choropleths, which I had thought inherited the Layer class. I’ve also tried adding the choropleth to a FeatureGroup
with show = False
, but this doesn’t work because choropleth is a method of a Map
object.
What am I doing wrong? or is there not currently a way to only display one choropleth layer on load?
Output of folium.__version__
0.6.0
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Toggle or Show parameter for choropleth layers not working as ...
Toggle or Show parameter for choropleth layers not working as expected. ... m.choropleth(name = 'Registered Electric Vehicles',geo_data = zips, data = zips, ...
Read more >Choropleth layer selection does not work in Leaflet
1 Answer 1 · In event processing function change you set new event processing with $("select"). · For adding and removing layers with...
Read more >Using Choropleth Layers with HANA Cloud and SAP Analytics ...
If your geo maps are still not working, check the location dimension is still valid and defined as expected. Figure%3A. Figure: 5.1 Click...
Read more >Multiple choropleth layers apply different styles - Stack Overflow
I'm looking to have 2 different choropleth layers available for the user to select in the layer control that are displayed one at...
Read more >Map board - Palantir
Cluster; Choropleth; Line segment. Currently, static layers (which are commonly used in Workshop maps) are not supported in the map board.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @conengmo! This is a great improvement and lets me delete a lot of spaghetti.
choropleths are now made by using the
Choropleth
class, which has ashow
argument. See also the example notebook on geojson and choropleths.