We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 17fc93a commit 5ef7a91Copy full SHA for 5ef7a91
ipyleaflet/leaflet.py
@@ -612,6 +612,7 @@ class Choropleth(GeoJSON):
612
value_min = Float(None, allow_none=True)
613
value_max = Float(None, allow_none=True)
614
colormap = Instance(ColorMap)
615
+ key_on = Unicode('id')
616
617
@observe('choro_data')
618
def _update_bounds(self, change):
@@ -650,7 +651,7 @@ def _get_data(self):
650
651
data = copy.deepcopy(self.geo_data)
652
653
for feature in data['features']:
- feature['properties']['style'] = self.style_callback(feature, colormap, self.choro_data[feature['id']])
654
+ feature['properties']['style'] = self.style_callback(feature, colormap, self.choro_data[feature[self.key_on]])
655
656
return data
657
0 commit comments