using some slightly modified examples in https://plotly.com/python/tile-scatter-maps/.
If I try (FYI need to install geopandas<1.0, note removal of the zoom setting):
importplotly.expressaspximportgeopandasasgpdgeo_df=gpd.read_file(gpd.datasets.get_path("naturalearth_cities"))
fig=px.scatter_map(
geo_df,
lat=geo_df.geometry.y,
lon=geo_df.geometry.x,
hover_name="name",
)
fig.show()Then I get:

Which is bad. We should set the Zoom to cover as many points as possible. Centroid on Africa seems reasonable for this example but not sure how it's determined.
Though I notice with some PX calls the centre point seems set automatically (note I removed the zoom level):
importplotly.expressaspxdf=px.data.carshare()
fig=px.scatter_map(
df,
lat="centroid_lat",
lon="centroid_lon",
color="peak_hour",
size="car_hours",
color_continuous_scale=px.colors.cyclical.IceFire,
)
fig.show()

Some investigation required to understand the current behaviour.
using some slightly modified examples in https://plotly.com/python/tile-scatter-maps/.
If I try (FYI need to install
geopandas<1.0, note removal of the zoom setting):Then I get:
Which is bad. We should set the Zoom to cover as many points as possible. Centroid on Africa seems reasonable for this example but not sure how it's determined.
Though I notice with some PX calls the centre point seems set automatically (note I removed the zoom level):
Some investigation required to understand the current behaviour.