Skip to content

Commit 68b59b8

Browse files
authored
Avoid setting empty style for GeoJson object (#559)
1 parent 9ac91fc commit 68b59b8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ipyleaflet/leaflet.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -571,16 +571,16 @@ def _update_data(self, change):
571571
def _get_data(self):
572572
if self.style_callback:
573573
if self.data['type'] == 'Feature':
574-
self.data['properties']['style'] = self.style_callback(self.data)
574+
self.data['properties']['style'].update(self.style_callback(self.data))
575575
elif self.data['type'] == 'FeatureCollection':
576576
for feature in self.data['features']:
577-
feature['properties']['style'] = self.style_callback(feature)
578-
else:
577+
feature['properties']['style'].update(self.style_callback(feature))
578+
elif self.style:
579579
if self.data['type'] == 'Feature':
580-
self.data['properties']['style'] = self.style
580+
self.data['properties']['style'].update(self.style)
581581
elif self.data['type'] == 'FeatureCollection':
582582
for feature in self.data['features']:
583-
feature['properties']['style'] = self.style
583+
feature['properties']['style'].update(self.style)
584584
return self.data
585585

586586
def __init__(self, **kwargs):

0 commit comments

Comments
 (0)