Skip to content

Commit e1674ce

Browse files
Add index argument in LinearColormap to properly set a piecewise linear colormap with custom boundary colors and values.
1 parent 6f8773e commit e1674ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ipyleaflet/leaflet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ def _get_data(self):
835835
colors = list(self.gradient.values())
836836
self.vmin = values[0]
837837
self.vmax = values[-1]
838-
self.colormap = LinearColormap(colors, vmin=self.vmin, vmax=self.vmax)
838+
self.colormap = LinearColormap(colors=colors, index=values, vmin=self.vmin, vmax=self.vmax)
839839

840840

841841
class VectorTileLayer(Layer):

0 commit comments

Comments
 (0)