from ipyleaflet import Map, GeoData
import geopandas
import numpy as np
import shapely
# Generate 100k random points around the world.
point_count = 100000
random_locs = np.array(
[np.random.uniform(-90, 90, point_count), np.random.uniform(-180, 180, point_count)]
).transpose((1, 0))
m = Map(center=(48.1, 17.1), zoom=8, prefer_canvas=True)
gdf = geopandas.GeoDataFrame(
geometry=[shapely.geometry.Point(loc) for loc in random_locs], crs="EPSG:4326"
)
geo_data = GeoData(
geo_dataframe=gdf,
hover_style={"fillColor": "red", "fillOpacity": 0.2},
point_style={"radius": 5, "fillOpacity": 0.8, "fillColor": "blue", "weight": 3},
)
m.add(geo_data)
m