Cesium
In [ ]:
Copied!
# %pip install mapwidget
# %pip install mapwidget
In [ ]:
Copied!
import os
import mapwidget.cesium as mapwidget
import os
import mapwidget.cesium as mapwidget
You need a Cesium access token to use the Cesium widget. First, sign up for a free Cesium account. Then, you can create a token by following the instructions here. Set CESIUM_TOKEN
as an environment variable to use the Cesium widget. Alternatively, uncomment the following code block and replace YOUR-CESIUM-TOKEN
with your Cesium access token.
In [ ]:
Copied!
if os.environ.get("CESIUM_TOKEN") is None:
token = "YOUR-CESIUM-TOKEN"
else:
token = os.environ.get("CESIUM_TOKEN")
if os.environ.get("CESIUM_TOKEN") is None:
token = "YOUR-CESIUM-TOKEN"
else:
token = os.environ.get("CESIUM_TOKEN")
San Francisco
In [ ]:
Copied!
m = mapwidget.Map(center=[37.655, -122.4175], altitude=400, height="600px", token=token)
m
m = mapwidget.Map(center=[37.655, -122.4175], altitude=400, height="600px", token=token)
m
New York City
In [ ]:
Copied!
m = mapwidget.Map(
center=[40.70605, -74.01177], altitude=600, height="600px", token=token
)
m
m = mapwidget.Map(
center=[40.70605, -74.01177], altitude=600, height="600px", token=token
)
m
In [ ]:
Copied!
m.center
m.center
In [ ]:
Copied!
m.zoom
m.zoom