MCPcopy Create free account
hub / github.com/python-visualization/folium / style_function

Function style_function

tests/plugins/test_pattern.py:23–39  ·  view source on GitHub ↗
(feature)

Source from the content-addressed store, hash-verified

21 )
22
23 def style_function(feature):
24 default_style = {
25 "opacity": 1.0,
26 "fillColor": "#ffff00",
27 "color": "black",
28 "weight": 2,
29 }
30
31 if feature["properties"]["name"] == "Colorado":
32 default_style["fillPattern"] = stripes
33 default_style["fillOpacity"] = 1.0
34
35 if feature["properties"]["name"] == "Utah":
36 default_style["fillPattern"] = circles
37 default_style["fillOpacity"] = 1.0
38
39 return default_style
40
41 data = os.path.join(os.path.dirname(__file__), os.pardir, "us-states.json")
42 folium.GeoJson(data, style_function=style_function).add_to(m)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…