Skip to content

Commit f006bfa

Browse files
committed
colormap type in ColorLine
1 parent 3a681da commit f006bfa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

folium/features.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1968,8 +1968,11 @@ def __init__(
19681968
vmin=min(colors),
19691969
vmax=max(colors),
19701970
).to_step(nb_steps)
1971-
else:
1971+
elif isinstance(colormap, StepColormap):
19721972
cm = colormap
1973+
else:
1974+
raise TypeError(f"Unexpected type for argument `colormap`: {type(colormap)}")
1975+
19731976
out: Dict[str, List[List[List[float]]]] = {}
19741977
for (lat1, lng1), (lat2, lng2), color in zip(coords[:-1], coords[1:], colors):
19751978
out.setdefault(cm(color), []).append([[lat1, lng1], [lat2, lng2]])

0 commit comments

Comments
 (0)