Lines on maps with text above line visible possible?


I have a GeoPandas frame which is similar to the example on the Plotly website. Is it possible to show the names as text above the lines?

import as px
import geopandas as gpd
import shapely.geometry
import numpy as np
import wget

# download a zipped shapefile"")

# open a zipped shapefile with the zip:// pseudo-protocol
geo_df = gpd.read_file("zip://")

lats = []
lons = []
names = []

for feature, name in zip(geo_df.geometry,
    if isinstance(feature, shapely.geometry.linestring.LineString):
        linestrings = [feature]
    elif isinstance(feature, shapely.geometry.multilinestring.MultiLineString):
        linestrings = feature.geoms
    for linestring in linestrings:
        x, y = linestring.xy
        lats = np.append(lats, y)
        lons = np.append(lons, x)
        names = np.append(names, [name]*len(y))
        lats = np.append(lats, None)
        lons = np.append(lons, None)
        names = np.append(names, None)

fig = px.line_geo(lat=lats, lon=lons, hover_name=names)

It is possible to display with text=names. In this example, each coordinate has a name, so the names overlap and are not practical. The duplicate names and coordinates should be made single.

fig = px.line_geo(lat=lats, lon=lons, hover_name=names, text=names)