diff --git a/src/sgis/maps/explore.py b/src/sgis/maps/explore.py index 475a2c62..810e007d 100644 --- a/src/sgis/maps/explore.py +++ b/src/sgis/maps/explore.py @@ -5,9 +5,9 @@ """ import os import warnings +from collections.abc import Iterable from numbers import Number from statistics import mean -from collections.abc import Iterable import branca as bc import folium @@ -126,7 +126,7 @@ def __init__( if self.gdfs is None: return - # stringify or remove columns not renerable by leaflet (list etc.) + # stringify or remove columns not renerable by leaflet (list, geometry etc.) new_gdfs, show_new = [], [] for gdf, show in zip(self.gdfs, self.show, strict=True): for col in gdf.columns: @@ -675,8 +675,10 @@ def _style_highlight(x): tooltip = None popup = None + gdf_as_json = gdf.__geo_interface__ + return folium.GeoJson( - gdf.__geo_interface__, + gdf_as_json, tooltip=tooltip, popup=popup, marker=marker, @@ -690,7 +692,6 @@ def _style_highlight(x): def _tooltip_popup(type, fields, gdf, **kwds): """get tooltip or popup""" - import folium # specify fields to show in the tooltip if fields is False or fields is None or fields == 0: