I followed the advice of using
fig.add_scattergeo(
geojson=counties,
locations = df['names'],
text = df['values'],
featureidkey="properties.NAME_3",
mode = 'text')
and I get the figure just as before. There is no error, it gets plotted, but there is no static annotation being displayed. I thought maybe I should somehow update the figure, so I added the lines
fig.update_geos(fitbounds="locations", visible=False)
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
and still no change. What am I missing?
Here is my full code:
fig = px.choropleth_mapbox(df_choro, geojson=geojson,color=df_choro['Презастрояване'],
locations=df_choro.index, featureidkey="properties.Name",
center={"lat": 42.694865, "lon": 23.320813},
mapbox_style="carto-positron", zoom=10)
fig.add_scattergeo(
geojson=geojson,
locations = df_choro.index,
text = df_choro['Презастрояване'],
featureidkey="properties.Name",
mode = 'text')
fig.update_geos(fitbounds="locations", visible=False)
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
fig.show()
and here is what I am getting: