`leafmap.leafmap` fails to `add_gdf` if index is numeric and does not start with 0
patel-zeel opened this issue · 0 comments
patel-zeel commented
Environment Information
- leafmap version: 0.38.6
- Python version: 3.10.12
- Operating System: Ubuntu 20.04.6 LTS
Description
leafmap.leafmap
fails to show the gdf
if index does not start with 0? Sometimes, we filter gdf during preprocessing, and thus, the index does not start with 0. leafmap.foliumap
works with any index.
show_what_fails = True
import geopandas as gpd
from shapely.geometry import Point
if show_what_fails:
import leafmap.leafmap as leafmap
else:
import leafmap.foliumap as leafmap
gdf = gpd.GeoDataFrame({"geometry": [Point(70.778174, 26.654166)]}, crs="EPSG:4326")
gdf.index = [1]
m = leafmap.Map()
m.add_basemap("HYBRID")
m.add_gdf(gdf)
m