Comments (1)
As to why you are not seeing a map. Add map_provider="mapbox"
to pdk.Deck
. Default map provider is carto
and they do not seem to support map_style.SATELLITE
. Look here for supported styles of carto.
r = pdk.Deck(
bitmap_layer,
initial_view_state=view_state,
map_provider="mapbox",
map_style=pdk.map_styles.SATELLITE,
)
For me the bitmap won't load due to a 403 Forbidden from imgur. Not sure why as loading the URL directly works fine. Possibly just an issue with using imgur.
Using the example from deck.gl documentation works fine for me. They use this URL: https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/sf-districts.png
You should not need to double Quote the URL either.
Here is the version I got running:
import os
import dash
import dash_deck
from dash import html
import pydeck as pdk
mapbox_api_token = os.getenv("MAPBOX_ACCESS_TOKEN")
app = dash.Dash(__name__)
# Map of San Francisco from 1906
IMG_URL = 'https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/sf-districts.png'
# Specifies the corners of the image bounding box
BOUNDS = [-122.5190, 37.7045, -122.355, 37.829]
bitmap_layer = pdk.Layer(
"BitmapLayer", image=IMG_URL, bounds=BOUNDS, opacity=0.7
)
view_state = pdk.ViewState(
latitude=37.7576171, longitude=-122.5776844, zoom=10, bearing=-45, pitch=60,
)
r = pdk.Deck(
bitmap_layer,
initial_view_state=view_state,
map_provider="mapbox",
map_style=pdk.map_styles.SATELLITE,
)
app.layout = html.Div(
dash_deck.DeckGL(r.to_json(), id="deck-gl", mapboxKey=mapbox_api_token)
)
if __name__ == "__main__":
app.run_server(debug=False)
from dash-deck.
Related Issues (11)
- Demo: ArcLayer
- Is it possible to get the zoom level of map? HOT 1
- Render a Scenegraph Layer
- DeckGL compatibility is affecting mobile rendering
- Map not displaying when using columnLayer
- Please Upgrade to the latest DeckGl.js HOT 2
- Dash Deck Data Allocation: GeoJSON Handling HOT 1
- Line-layer demo shows far less data than equivalent deck.gl demo yet both use same data source. HOT 2
- Mirrored into conda-forge? HOT 1
- Is it possible to update map in a callback function based on the value of other components? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dash-deck.