|
1 | 1 | { |
2 | | - "cells": [ |
3 | | - { |
4 | | - "attachments": {}, |
5 | | - "cell_type": "markdown", |
6 | | - "metadata": {}, |
7 | | - "source": [ |
8 | | - "[](https://studiolab.sagemaker.aws/import/github/opengeos/mapwidget/blob/master/docs/examples/cesium.ipynb)\n", |
9 | | - "[](https://colab.research.google.com/github/opengeos/mapwidget/blob/master/docs/examples/cesium.ipynb)" |
10 | | - ] |
11 | | - }, |
12 | | - { |
13 | | - "cell_type": "code", |
14 | | - "execution_count": null, |
15 | | - "metadata": {}, |
16 | | - "outputs": [], |
17 | | - "source": [ |
18 | | - "# %pip install mapwidget" |
19 | | - ] |
20 | | - }, |
21 | | - { |
22 | | - "cell_type": "code", |
23 | | - "execution_count": null, |
24 | | - "metadata": {}, |
25 | | - "outputs": [], |
26 | | - "source": [ |
27 | | - "import os\n", |
28 | | - "import mapwidget.cesium as mapwidget" |
29 | | - ] |
30 | | - }, |
31 | | - { |
32 | | - "attachments": {}, |
33 | | - "cell_type": "markdown", |
34 | | - "metadata": {}, |
35 | | - "source": [ |
36 | | - "You need a Cesium access token to use the Cesium widget. First, [sign up](https://ion.cesium.com/signup/) for a free Cesium account. Then, you can create a token by following the instructions [here](https://cesium.com/learn/ion/cesium-ion-access-tokens/). 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." |
37 | | - ] |
38 | | - }, |
39 | | - { |
40 | | - "cell_type": "code", |
41 | | - "execution_count": null, |
42 | | - "metadata": {}, |
43 | | - "outputs": [], |
44 | | - "source": [ |
45 | | - "if os.environ.get(\"CESIUM_TOKEN\") is None:\n", |
46 | | - " token = \"YOUR-CESIUM-TOKEN\"\n", |
47 | | - "else:\n", |
48 | | - " token = os.environ.get(\"CESIUM_TOKEN\")" |
49 | | - ] |
50 | | - }, |
51 | | - { |
52 | | - "attachments": {}, |
53 | | - "cell_type": "markdown", |
54 | | - "metadata": {}, |
55 | | - "source": [ |
56 | | - "San Francisco" |
57 | | - ] |
58 | | - }, |
59 | | - { |
60 | | - "cell_type": "code", |
61 | | - "execution_count": null, |
62 | | - "metadata": {}, |
63 | | - "outputs": [], |
64 | | - "source": [ |
65 | | - "m = mapwidget.Map(center=[37.655, -122.4175], altitude=400, height=\"600px\", token=token)\n", |
66 | | - "m" |
67 | | - ] |
68 | | - }, |
69 | | - { |
70 | | - "attachments": {}, |
71 | | - "cell_type": "markdown", |
72 | | - "metadata": {}, |
73 | | - "source": [ |
74 | | - "" |
75 | | - ] |
76 | | - }, |
77 | | - { |
78 | | - "attachments": {}, |
79 | | - "cell_type": "markdown", |
80 | | - "metadata": {}, |
81 | | - "source": [ |
82 | | - "New York City" |
83 | | - ] |
84 | | - }, |
85 | | - { |
86 | | - "cell_type": "code", |
87 | | - "execution_count": null, |
88 | | - "metadata": {}, |
89 | | - "outputs": [], |
90 | | - "source": [ |
91 | | - "m = mapwidget.Map(\n", |
92 | | - " center=[40.70605, -74.01177], altitude=600, height=\"600px\", token=token\n", |
93 | | - ")\n", |
94 | | - "m" |
95 | | - ] |
96 | | - }, |
97 | | - { |
98 | | - "attachments": {}, |
99 | | - "cell_type": "markdown", |
100 | | - "metadata": {}, |
101 | | - "source": [ |
102 | | - "" |
103 | | - ] |
104 | | - }, |
105 | | - { |
106 | | - "cell_type": "code", |
107 | | - "execution_count": null, |
108 | | - "metadata": {}, |
109 | | - "outputs": [], |
110 | | - "source": [ |
111 | | - "m.center" |
112 | | - ] |
113 | | - }, |
114 | | - { |
115 | | - "cell_type": "code", |
116 | | - "execution_count": null, |
117 | | - "metadata": {}, |
118 | | - "outputs": [], |
119 | | - "source": [ |
120 | | - "m.zoom" |
121 | | - ] |
122 | | - } |
123 | | - ], |
124 | | - "metadata": { |
125 | | - "kernelspec": { |
126 | | - "display_name": "Python 3 (ipykernel)", |
127 | | - "language": "python", |
128 | | - "name": "python3" |
129 | | - }, |
130 | | - "language_info": { |
131 | | - "codemirror_mode": { |
132 | | - "name": "ipython", |
133 | | - "version": 3 |
134 | | - }, |
135 | | - "file_extension": ".py", |
136 | | - "mimetype": "text/x-python", |
137 | | - "name": "python", |
138 | | - "nbconvert_exporter": "python", |
139 | | - "pygments_lexer": "ipython3", |
140 | | - "version": "3.10.9" |
141 | | - } |
142 | | - }, |
143 | | - "nbformat": 4, |
144 | | - "nbformat_minor": 4 |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "attachments": {}, |
| 5 | + "cell_type": "markdown", |
| 6 | + "metadata": {}, |
| 7 | + "source": [ |
| 8 | + "[](https://studiolab.sagemaker.aws/import/github/opengeos/mapwidget/blob/master/docs/examples/cesium.ipynb)\n", |
| 9 | + "[](https://colab.research.google.com/github/opengeos/mapwidget/blob/master/docs/examples/cesium.ipynb)" |
| 10 | + ] |
| 11 | + }, |
| 12 | + { |
| 13 | + "cell_type": "code", |
| 14 | + "execution_count": null, |
| 15 | + "metadata": {}, |
| 16 | + "outputs": [], |
| 17 | + "source": [ |
| 18 | + "# %pip install mapwidget" |
| 19 | + ] |
| 20 | + }, |
| 21 | + { |
| 22 | + "cell_type": "code", |
| 23 | + "execution_count": null, |
| 24 | + "metadata": {}, |
| 25 | + "outputs": [], |
| 26 | + "source": [ |
| 27 | + "import os\n", |
| 28 | + "import mapwidget.cesium as mapwidget" |
| 29 | + ] |
| 30 | + }, |
| 31 | + { |
| 32 | + "attachments": {}, |
| 33 | + "cell_type": "markdown", |
| 34 | + "metadata": {}, |
| 35 | + "source": [ |
| 36 | + "You need a Cesium access token to use the Cesium widget. First, [sign up](https://ion.cesium.com/signup/) for a free Cesium account. Then, you can create a token by following the instructions [here](https://cesium.com/learn/ion/cesium-ion-access-tokens/). 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." |
| 37 | + ] |
| 38 | + }, |
| 39 | + { |
| 40 | + "cell_type": "code", |
| 41 | + "execution_count": null, |
| 42 | + "metadata": {}, |
| 43 | + "outputs": [], |
| 44 | + "source": [ |
| 45 | + "if os.environ.get(\"CESIUM_TOKEN\") is None:\n", |
| 46 | + " token = \"YOUR-CESIUM-TOKEN\"\n", |
| 47 | + "else:\n", |
| 48 | + " token = os.environ.get(\"CESIUM_TOKEN\")" |
| 49 | + ] |
| 50 | + }, |
| 51 | + { |
| 52 | + "attachments": {}, |
| 53 | + "cell_type": "markdown", |
| 54 | + "metadata": {}, |
| 55 | + "source": [ |
| 56 | + "San Francisco" |
| 57 | + ] |
| 58 | + }, |
| 59 | + { |
| 60 | + "cell_type": "code", |
| 61 | + "execution_count": null, |
| 62 | + "metadata": {}, |
| 63 | + "outputs": [], |
| 64 | + "source": [ |
| 65 | + "m = mapwidget.Map(center=[37.655, -122.4175], altitude=400, height=\"600px\", token=token)\n", |
| 66 | + "m" |
| 67 | + ] |
| 68 | + }, |
| 69 | + { |
| 70 | + "attachments": {}, |
| 71 | + "cell_type": "markdown", |
| 72 | + "metadata": {}, |
| 73 | + "source": [ |
| 74 | + "" |
| 75 | + ] |
| 76 | + }, |
| 77 | + { |
| 78 | + "attachments": {}, |
| 79 | + "cell_type": "markdown", |
| 80 | + "metadata": {}, |
| 81 | + "source": [ |
| 82 | + "New York City" |
| 83 | + ] |
| 84 | + }, |
| 85 | + { |
| 86 | + "cell_type": "code", |
| 87 | + "execution_count": null, |
| 88 | + "metadata": {}, |
| 89 | + "outputs": [], |
| 90 | + "source": [ |
| 91 | + "m = mapwidget.Map(\n", |
| 92 | + " center=[40.70605, -74.01177], altitude=600, height=\"600px\", token=token\n", |
| 93 | + ")\n", |
| 94 | + "m" |
| 95 | + ] |
| 96 | + }, |
| 97 | + { |
| 98 | + "attachments": {}, |
| 99 | + "cell_type": "markdown", |
| 100 | + "metadata": {}, |
| 101 | + "source": [ |
| 102 | + "" |
| 103 | + ] |
| 104 | + }, |
| 105 | + { |
| 106 | + "cell_type": "code", |
| 107 | + "execution_count": null, |
| 108 | + "metadata": {}, |
| 109 | + "outputs": [], |
| 110 | + "source": [ |
| 111 | + "m.center" |
| 112 | + ] |
| 113 | + }, |
| 114 | + { |
| 115 | + "cell_type": "code", |
| 116 | + "execution_count": null, |
| 117 | + "metadata": {}, |
| 118 | + "outputs": [], |
| 119 | + "source": [ |
| 120 | + "m.zoom" |
| 121 | + ] |
| 122 | + } |
| 123 | + ], |
| 124 | + "metadata": { |
| 125 | + "kernelspec": { |
| 126 | + "display_name": "Python 3 (ipykernel)", |
| 127 | + "language": "python", |
| 128 | + "name": "python3" |
| 129 | + }, |
| 130 | + "language_info": { |
| 131 | + "codemirror_mode": { |
| 132 | + "name": "ipython", |
| 133 | + "version": 3 |
| 134 | + }, |
| 135 | + "file_extension": ".py", |
| 136 | + "mimetype": "text/x-python", |
| 137 | + "name": "python", |
| 138 | + "nbconvert_exporter": "python", |
| 139 | + "pygments_lexer": "ipython3", |
| 140 | + "version": "3.10.9" |
| 141 | + } |
| 142 | + }, |
| 143 | + "nbformat": 4, |
| 144 | + "nbformat_minor": 4 |
145 | 145 | } |
0 commit comments