BUG: gdf.explore()
method fails when highlight_kwds
contains custom style_function
#3031
Labels
gdf.explore()
method fails when highlight_kwds
contains custom style_function
#3031
[Y] I have checked that this issue has not already been reported.
[Y] I have confirmed this bug exists on the latest version of geopandas.
(optional) I have confirmed this bug exists on the main branch of geopandas.
Code Sample, a copy-pastable example
Problem description
TypeError: Object of type function is not JSON serializable
Expected Output
Interactive map with 3 points which color changes to red if mouse is over them.
My solution
I looked into
explore.py
and at line 570 found this codeAfter making it similar to how
style_kwds
is treated, eg.code from example above works as expected.
Output of
geopandas.show_versions()
SYSTEM INFO
python : 3.11.5 | packaged by conda-forge | (main, Aug 27 2023, 03:23:48) [MSC v.1936 64 bit (AMD64)]
executable : C:\PROGRAMY\Anaconda\envs\geo_env\python.exe
machine : Windows-10-10.0.19045-SP0
GEOS, GDAL, PROJ INFO
GEOS : 3.12.0
GEOS lib : None
GDAL : 3.7.2
GDAL data dir: None
PROJ : 9.2.1
PROJ data dir: C:\PROGRAMY\Anaconda\envs\geo_env\Library\share\proj
PYTHON DEPENDENCIES
geopandas : 0.14.0
numpy : 1.26.0
pandas : 2.1.1
pyproj : 3.6.1
shapely : 2.0.1
fiona : 1.9.4
geoalchemy2: None
geopy : 2.4.0
matplotlib : 3.8.0
mapclassify: 2.5.0
pygeos : None
pyogrio : None
psycopg2 : None
pyarrow : 13.0.0
rtree : 1.0.1
The text was updated successfully, but these errors were encountered: