How to plot lines between locations on a map at a city level=

@mimapper You can draw lines on a map plotted by mapbox, too.
The lon and lat along the lines should be defined within a dict having the structure of a geojson type file https://en.wikipedia.org/wiki/GeoJSON.

Pass the dict to mapbox via layers:

layers=[dict(sourcetype = 'geojson',
         source =the_geojson_type_dict,
         color='rgb(0,0,230)',
         type = 'line',
         line=dict(width=1.5),
   )
     ]  
     
layout = dict(
title='Lines in mapbox, via geojson data',
autosize=False,
width=800,
height=800,
hovermode='closest',

mapbox=dict(
    accesstoken=mapbox_access_token,
    layers=layers,
    bearing=0,
    center=dict(
        lat=45.778408,
        lon=3.085790
    ),
    pitch=0,
    zoom=4.75,
    #style='light'
)
)

See also in this example https://www.mapbox.com/mapbox-gl-js/example/geojson-line/
how the geojson type dict can be defined inside the layer definition.

1 Like