Adding maps without using mapbox

Hello,

is it somehow possible to draw a map on a dashboard without having to get an mapbox-key?
I would like to use my own custom shapefiles or use openstreetmap-data.

Thanks in advance &
kind regards :slight_smile:

1 Like

If you work with shapefiles, you will probably need Shapely. And maybe also Cartopy.

To embed images in a Dash component, this answer and this thread might be useful.

See also:

Hi! Can you solve this? Is there any code example?

Thank you.

As I can see, this resources are not interactive as Mapbox (mouse hover, click actions, etc…). Am I right?

Thank you!

@masio_gelp You’re right: if you don’t use mapbox (or perhaps Google Maps), then your maps will be mostly static. users can hover over datapoints to get values, but can’t pan/zoom.

Here’s an example of a ScatterPlot Plotly plot which can quickly be turned into a full Plotly Dash app:

You can turn this (or any) Plotly example into Plotly Dash app by adding this code before the example code:

import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
app = dash.Dash()

And then at the end of a Plotly example where you see code like py.iplot( fig, filename='some_name' ), just replace it with these lines:

app.layout = html.Div([
    dcc.Graph(id='graph', figure=fig)
])

if __name__ == '__main__':
    app.run_server(debug=True)

We’re working on adding the ability to use alternative tileservers in scattermapbox (e.g. open street map instead of mapbox). I’ll keep this thread updated with progress

4 Likes

Would love to see alternatives to MapBox. OSM is a great free alternative. Can’t wait to see it getting implemented and using it in my website.