Please add a code sample or a nbviewer link, copy-pastable if possible
This works fine:
geo_json_data = """
{
"type": "FeatureCollection",
"features": []
}
m = folium.Map([43, -100], zoom_start=4)
folium.GeoJson(
geo_json_data
).add_to(m)
m
But this does not:
geo_json_data = """
{
"type": "FeatureCollection",
"features": []
}
m = folium.Map([43, -100], zoom_start=4)
folium.GeoJson(
geo_json_data,
style_function=lambda feature: {
'fillColor': '#ffff00',
'color': 'black',
'weight': 2,
'dashArray': '5, 5'
}
).add_to(m)
m
"""
Problem description
Sometimes a user ends up attempting to plot empty GeoJson (e.g., it came from an API response with no results).
Normally this works, but will fail if you use it in conjunction with a style_function .
Expected Output
I would expect to see an empty plot even when attempting to plot an empty GeoJson.
Output of folium.__version__
0.10.0+2.g60ae79c.dirty
Please add a code sample or a nbviewer link, copy-pastable if possible
This works fine:
But this does not:
Problem description
Sometimes a user ends up attempting to plot empty GeoJson (e.g., it came from an API response with no results).
Normally this works, but will fail if you use it in conjunction with a
style_function.Expected Output
I would expect to see an empty plot even when attempting to plot an empty GeoJson.
Output of
folium.__version__0.10.0+2.g60ae79c.dirty