Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Mapbox: 3D/extrude buildings

$
0
0

@anjulia wrote:

Hi, I’m new to the plotly and mapbox environment. I want to build an interactive map from mapbox. I want the buildings to be extruded so it’s in 3D so it looks something like this:

I’ve tried these lines in my Python environment:

mapbox = dict(
accesstoken = ‘pk.eyJ1IjoiYW5qdWxpYSIsImEiOiJjazYyMTFtNGUwOGxoM21xMWE1N2ZtYmd5In0.mcnB8ehS3d_JGnh_lYSEzA’
style = ‘mapbox://styles/srepho/cjttho6dl0hl91fmzwyicqkzf’
)

#mapbox_access_token = ‘pk.eyJ1IjoiYW5qdWxpYSIsImEiOiJjazYyMTFtNGUwOGxoM21xMWE1N2ZtYmd5In0.mcnB8ehS3d_JGnh_lYSEzA’
#style = ‘mapbox://styles/anjulia/ck6212zuo0n7k1irz2cvd377i’

data = [
go.Scattermapbox(
lat=[‘57.72849’],
lon=[‘11.9745’],

    mode='markers',
    marker=go.scattermapbox.Marker(
        size=14
    ),
    text=['Göteborg'],
)

]

layout = go.Layout(
autosize=True,
hovermode=‘closest’,
mapbox=go.layout.Mapbox(
accesstoken=mapbox_access_token,
bearing=0,
center=go.layout.mapbox.Center(
lat=57,
lon=11
),
pitch=0,
zoom=5
),
)

fig = go.Figure(data=data, layout=layout)
py.iplot(fig, filename=‘Montreal Mapbox’)

the “style”-url is the one I get from my edited mapbox-map. The error-code I get looks like this:

image

I don’t need my code to look like that, I just want a 3D map with extruded buildings to use on a webpage that I later can get information from.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 6271

Latest Images

Trending Articles



Latest Images