Skip to content

Commit b397127

Browse files
Vector Tile Layer (#26)
* added vectortilelayer +change tilelayer to ratsertilelayer * added style * Update Playwright Snapshots * Deleted unnecessary file --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent b1e59e4 commit b397127

15 files changed

+3168
-2550
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ ehthumbs.db
128128

129129
# Folder config file
130130
Desktop.ini
131+
.config.ini
131132

132133
# Recycle Bin used on file shares
133134
$RECYCLE.BIN/

examples/RasterLayer.ipynb

+158
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Introduction"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": 1,
13+
"metadata": {},
14+
"outputs": [],
15+
"source": [
16+
"from ipyopenlayers import Map, RasterTileLayer"
17+
]
18+
},
19+
{
20+
"cell_type": "code",
21+
"execution_count": 2,
22+
"metadata": {},
23+
"outputs": [],
24+
"source": [
25+
"import configparser\n",
26+
"config = configparser.ConfigParser()\n",
27+
"config.read('.config.ini')\n",
28+
"key = config['DEFAULT']['key']"
29+
]
30+
},
31+
{
32+
"cell_type": "code",
33+
"execution_count": 3,
34+
"metadata": {
35+
"scrolled": true
36+
},
37+
"outputs": [
38+
{
39+
"data": {
40+
"application/vnd.jupyter.widget-view+json": {
41+
"model_id": "bf54f7b270eb4c12ba2fbcaeea2583da",
42+
"version_major": 2,
43+
"version_minor": 0
44+
},
45+
"text/plain": [
46+
"Map(center=[4.299875503991089, 46.85012303279379], zoom=0.0)"
47+
]
48+
},
49+
"execution_count": 3,
50+
"metadata": {},
51+
"output_type": "execute_result"
52+
}
53+
],
54+
"source": [
55+
"m = Map(center=[4.299875503991089, 46.85012303279379], zoom=0)\n",
56+
"m"
57+
]
58+
},
59+
{
60+
"cell_type": "markdown",
61+
"metadata": {},
62+
"source": [
63+
"RasterTileLayer"
64+
]
65+
},
66+
{
67+
"cell_type": "code",
68+
"execution_count": 4,
69+
"metadata": {},
70+
"outputs": [],
71+
"source": [
72+
"layere=RasterTileLayer()"
73+
]
74+
},
75+
{
76+
"cell_type": "code",
77+
"execution_count": 5,
78+
"metadata": {},
79+
"outputs": [],
80+
"source": [
81+
"m.add_layer(layere) "
82+
]
83+
},
84+
{
85+
"cell_type": "code",
86+
"execution_count": 26,
87+
"metadata": {},
88+
"outputs": [],
89+
"source": [
90+
"attributions = '<a href=\"https://www.maptiler.com/copyright/\" target=\"_blank\">&copy; MapTiler</a> ' +'<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">&copy; OpenStreetMap contributors</a>';\n",
91+
"\n",
92+
"raster = RasterTileLayer(attributions=attributions,url='https://api.maptiler.com/maps/dataviz-dark/{z}/{x}/{y}.png?key=' + key,\n",
93+
" tileSize= 512)\n",
94+
"m.add_layer(raster) "
95+
]
96+
},
97+
{
98+
"cell_type": "code",
99+
"execution_count": 8,
100+
"metadata": {
101+
"scrolled": true
102+
},
103+
"outputs": [],
104+
"source": [
105+
"m.remove_layer(raster)"
106+
]
107+
},
108+
{
109+
"cell_type": "code",
110+
"execution_count": 9,
111+
"metadata": {
112+
"jupyter": {
113+
"source_hidden": true
114+
}
115+
},
116+
"outputs": [],
117+
"source": [
118+
"attributions = [\n",
119+
" '&copy; <a href=\"https://www.maptiler.com/copyright/\" target=\"_blank\">MapTiler</a>',\n",
120+
" '&copy; <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap contributors</a>'\n",
121+
"]\n",
122+
"\n",
123+
"rasterlay = RasterTileLayer(url=f'https://api.maptiler.com/maps/satellite/{{z}}/{{x}}/{{y}}.jpg?key={key}',attributions=attributions,tileSize=512,maxZoom=20)\n",
124+
"m.add_layer(rasterlay)"
125+
]
126+
},
127+
{
128+
"cell_type": "code",
129+
"execution_count": 11,
130+
"metadata": {},
131+
"outputs": [],
132+
"source": [
133+
"m.remove_layer(rasterlay)"
134+
]
135+
}
136+
],
137+
"metadata": {
138+
"kernelspec": {
139+
"display_name": "Python 3 (ipykernel)",
140+
"language": "python",
141+
"name": "python3"
142+
},
143+
"language_info": {
144+
"codemirror_mode": {
145+
"name": "ipython",
146+
"version": 3
147+
},
148+
"file_extension": ".py",
149+
"mimetype": "text/x-python",
150+
"name": "python",
151+
"nbconvert_exporter": "python",
152+
"pygments_lexer": "ipython3",
153+
"version": "3.10.14"
154+
}
155+
},
156+
"nbformat": 4,
157+
"nbformat_minor": 4
158+
}

0 commit comments

Comments
 (0)