@beyonk/svelte-mapbox 8.1.4 → 9.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +7 -3
- package/asset-loader.d.ts +1 -0
- package/{src/lib/asset-loader.js → asset-loader.js} +0 -0
- package/components.d.ts +13 -0
- package/{src/lib/components.js → components.js} +0 -0
- package/event-bindings.d.ts +1 -0
- package/{src/lib/event-bindings.js → event-bindings.js} +0 -0
- package/{src/lib/geocoder → geocoder}/Geocoder.svelte +0 -0
- package/geocoder/Geocoder.svelte.d.ts +53 -0
- package/geocoder/geocoder-action.d.ts +3 -0
- package/{src/lib/geocoder → geocoder}/geocoder-action.js +0 -0
- package/{src/lib/map → map}/Map.svelte +2 -1
- package/map/Map.svelte.d.ts +89 -0
- package/{src/lib/map → map}/Marker.svelte +0 -0
- package/map/Marker.svelte.d.ts +50 -0
- package/{src/lib/map → map}/controls/GeolocateControl.svelte +0 -0
- package/map/controls/GeolocateControl.svelte.d.ts +40 -0
- package/{src/lib/map → map}/controls/NavigationControl.svelte +0 -0
- package/map/controls/NavigationControl.svelte.d.ts +25 -0
- package/{src/lib/map → map}/controls/ScaleControl.svelte +0 -0
- package/map/controls/ScaleControl.svelte.d.ts +25 -0
- package/map/map-action.d.ts +3 -0
- package/{src/lib/map → map}/map-action.js +0 -0
- package/mapbox.d.ts +1 -0
- package/{src/lib/mapbox.js → mapbox.js} +0 -0
- package/package.json +28 -14
- package/queue.d.ts +8 -0
- package/{src/lib/queue.js → queue.js} +0 -0
- package/.env +0 -1
- package/.eslintignore +0 -2
- package/.eslintrc.json +0 -7
- package/.github/workflows/publish.yml +0 -35
- package/jsconfig.json +0 -10
- package/pnpm-lock.yaml +0 -230
- package/src/app.html +0 -17
- package/src/global.d.ts +0 -1
- package/src/lib/conf.js +0 -5
- package/src/routes/_Earthquakes.svelte +0 -128
- package/src/routes/_MiniScroller.svelte +0 -1
- package/src/routes/index.svelte +0 -211
- package/static/favicon.png +0 -0
- package/static/normalize.css +0 -76
- package/static/prettify.css +0 -70
- package/static/style.css +0 -534
- package/svelte.config.js +0 -8
package/pnpm-lock.yaml
DELETED
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
devDependencies:
|
|
2
|
-
'@sveltejs/kit': 1.0.0-next.132_svelte@3.38.3
|
|
3
|
-
svelte: 3.38.3
|
|
4
|
-
lockfileVersion: 5.2
|
|
5
|
-
packages:
|
|
6
|
-
/@rollup/pluginutils/4.1.1:
|
|
7
|
-
dependencies:
|
|
8
|
-
estree-walker: 2.0.2
|
|
9
|
-
picomatch: 2.3.0
|
|
10
|
-
dev: true
|
|
11
|
-
engines:
|
|
12
|
-
node: '>= 8.0.0'
|
|
13
|
-
resolution:
|
|
14
|
-
integrity: sha512-clDjivHqWGXi7u+0d2r2sBi4Ie6VLEAzWMIkvJLnDmxoOhBYOTfzGbOQBA32THHm11/LiJbd01tJUpJsbshSWQ==
|
|
15
|
-
/@sveltejs/kit/1.0.0-next.132_svelte@3.38.3:
|
|
16
|
-
dependencies:
|
|
17
|
-
'@sveltejs/vite-plugin-svelte': 1.0.0-next.13_svelte@3.38.3+vite@2.4.3
|
|
18
|
-
cheap-watch: 1.0.3
|
|
19
|
-
sade: 1.7.4
|
|
20
|
-
svelte: 3.38.3
|
|
21
|
-
vite: 2.4.3
|
|
22
|
-
dev: true
|
|
23
|
-
engines:
|
|
24
|
-
node: ^12.20 || >=14.13
|
|
25
|
-
hasBin: true
|
|
26
|
-
peerDependencies:
|
|
27
|
-
svelte: ^3.34.0
|
|
28
|
-
resolution:
|
|
29
|
-
integrity: sha512-mX3ihuyTQr3302ZpihG3gXfTBcDPODlJ6ZoYu6f7TGo8+1OdpuDdozgi1CKLkrUBHYGnPO4E75XOVKlgJLjBQw==
|
|
30
|
-
/@sveltejs/vite-plugin-svelte/1.0.0-next.13_svelte@3.38.3+vite@2.4.3:
|
|
31
|
-
dependencies:
|
|
32
|
-
'@rollup/pluginutils': 4.1.1
|
|
33
|
-
debug: 4.3.2
|
|
34
|
-
diff-match-patch: 1.0.5
|
|
35
|
-
kleur: 4.1.4
|
|
36
|
-
magic-string: 0.25.7
|
|
37
|
-
require-relative: 0.8.7
|
|
38
|
-
svelte: 3.38.3
|
|
39
|
-
svelte-hmr: 0.14.6_svelte@3.38.3
|
|
40
|
-
vite: 2.4.3
|
|
41
|
-
dev: true
|
|
42
|
-
engines:
|
|
43
|
-
node: ^12.20 || ^14.13.1 || >= 16
|
|
44
|
-
peerDependencies:
|
|
45
|
-
svelte: ^3.34.0
|
|
46
|
-
vite: ^2.3.7
|
|
47
|
-
resolution:
|
|
48
|
-
integrity: sha512-hzacNmIOR55aE+yQj750R90+BbQERRVGjlu6TQLgy+Aw2bPmRJMLKvS/NmwO+I66DEiWQdFFHR+lxtwH4bbbXw==
|
|
49
|
-
/cheap-watch/1.0.3:
|
|
50
|
-
dev: true
|
|
51
|
-
engines:
|
|
52
|
-
node: '>=8'
|
|
53
|
-
resolution:
|
|
54
|
-
integrity: sha512-xC5CruMhLzjPwJ5ecUxGu1uGmwJQykUhqd2QrCrYbwvsFYdRyviu6jG9+pccwDXJR/OpmOTOJ9yLFunVgQu9wg==
|
|
55
|
-
/colorette/1.2.2:
|
|
56
|
-
dev: true
|
|
57
|
-
resolution:
|
|
58
|
-
integrity: sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==
|
|
59
|
-
/debug/4.3.2:
|
|
60
|
-
dependencies:
|
|
61
|
-
ms: 2.1.2
|
|
62
|
-
dev: true
|
|
63
|
-
engines:
|
|
64
|
-
node: '>=6.0'
|
|
65
|
-
peerDependencies:
|
|
66
|
-
supports-color: '*'
|
|
67
|
-
peerDependenciesMeta:
|
|
68
|
-
supports-color:
|
|
69
|
-
optional: true
|
|
70
|
-
resolution:
|
|
71
|
-
integrity: sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==
|
|
72
|
-
/diff-match-patch/1.0.5:
|
|
73
|
-
dev: true
|
|
74
|
-
resolution:
|
|
75
|
-
integrity: sha512-IayShXAgj/QMXgB0IWmKx+rOPuGMhqm5w6jvFxmVenXKIzRqTAAsbBPT3kWQeGANj3jGgvcvv4yK6SxqYmikgw==
|
|
76
|
-
/esbuild/0.12.15:
|
|
77
|
-
dev: true
|
|
78
|
-
hasBin: true
|
|
79
|
-
requiresBuild: true
|
|
80
|
-
resolution:
|
|
81
|
-
integrity: sha512-72V4JNd2+48eOVCXx49xoSWHgC3/cCy96e7mbXKY+WOWghN00cCmlGnwVLRhRHorvv0dgCyuMYBZlM2xDM5OQw==
|
|
82
|
-
/estree-walker/2.0.2:
|
|
83
|
-
dev: true
|
|
84
|
-
resolution:
|
|
85
|
-
integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==
|
|
86
|
-
/fsevents/2.3.2:
|
|
87
|
-
dev: true
|
|
88
|
-
engines:
|
|
89
|
-
node: ^8.16.0 || ^10.6.0 || >=11.0.0
|
|
90
|
-
optional: true
|
|
91
|
-
os:
|
|
92
|
-
- darwin
|
|
93
|
-
resolution:
|
|
94
|
-
integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
|
|
95
|
-
/function-bind/1.1.1:
|
|
96
|
-
dev: true
|
|
97
|
-
resolution:
|
|
98
|
-
integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
|
|
99
|
-
/has/1.0.3:
|
|
100
|
-
dependencies:
|
|
101
|
-
function-bind: 1.1.1
|
|
102
|
-
dev: true
|
|
103
|
-
engines:
|
|
104
|
-
node: '>= 0.4.0'
|
|
105
|
-
resolution:
|
|
106
|
-
integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==
|
|
107
|
-
/is-core-module/2.5.0:
|
|
108
|
-
dependencies:
|
|
109
|
-
has: 1.0.3
|
|
110
|
-
dev: true
|
|
111
|
-
resolution:
|
|
112
|
-
integrity: sha512-TXCMSDsEHMEEZ6eCA8rwRDbLu55MRGmrctljsBX/2v1d9/GzqHOxW5c5oPSgrUt2vBFXebu9rGqckXGPWOlYpg==
|
|
113
|
-
/kleur/4.1.4:
|
|
114
|
-
dev: true
|
|
115
|
-
engines:
|
|
116
|
-
node: '>=6'
|
|
117
|
-
resolution:
|
|
118
|
-
integrity: sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==
|
|
119
|
-
/magic-string/0.25.7:
|
|
120
|
-
dependencies:
|
|
121
|
-
sourcemap-codec: 1.4.8
|
|
122
|
-
dev: true
|
|
123
|
-
resolution:
|
|
124
|
-
integrity: sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==
|
|
125
|
-
/mri/1.1.6:
|
|
126
|
-
dev: true
|
|
127
|
-
engines:
|
|
128
|
-
node: '>=4'
|
|
129
|
-
resolution:
|
|
130
|
-
integrity: sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==
|
|
131
|
-
/ms/2.1.2:
|
|
132
|
-
dev: true
|
|
133
|
-
resolution:
|
|
134
|
-
integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
|
|
135
|
-
/nanoid/3.1.23:
|
|
136
|
-
dev: true
|
|
137
|
-
engines:
|
|
138
|
-
node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1
|
|
139
|
-
hasBin: true
|
|
140
|
-
resolution:
|
|
141
|
-
integrity: sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==
|
|
142
|
-
/path-parse/1.0.7:
|
|
143
|
-
dev: true
|
|
144
|
-
resolution:
|
|
145
|
-
integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
|
|
146
|
-
/picomatch/2.3.0:
|
|
147
|
-
dev: true
|
|
148
|
-
engines:
|
|
149
|
-
node: '>=8.6'
|
|
150
|
-
resolution:
|
|
151
|
-
integrity: sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==
|
|
152
|
-
/postcss/8.3.5:
|
|
153
|
-
dependencies:
|
|
154
|
-
colorette: 1.2.2
|
|
155
|
-
nanoid: 3.1.23
|
|
156
|
-
source-map-js: 0.6.2
|
|
157
|
-
dev: true
|
|
158
|
-
engines:
|
|
159
|
-
node: ^10 || ^12 || >=14
|
|
160
|
-
resolution:
|
|
161
|
-
integrity: sha512-NxTuJocUhYGsMiMFHDUkmjSKT3EdH4/WbGF6GCi1NDGk+vbcUTun4fpbOqaPtD8IIsztA2ilZm2DhYCuyN58gA==
|
|
162
|
-
/require-relative/0.8.7:
|
|
163
|
-
dev: true
|
|
164
|
-
resolution:
|
|
165
|
-
integrity: sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=
|
|
166
|
-
/resolve/1.20.0:
|
|
167
|
-
dependencies:
|
|
168
|
-
is-core-module: 2.5.0
|
|
169
|
-
path-parse: 1.0.7
|
|
170
|
-
dev: true
|
|
171
|
-
resolution:
|
|
172
|
-
integrity: sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==
|
|
173
|
-
/rollup/2.53.2:
|
|
174
|
-
dev: true
|
|
175
|
-
engines:
|
|
176
|
-
node: '>=10.0.0'
|
|
177
|
-
hasBin: true
|
|
178
|
-
optionalDependencies:
|
|
179
|
-
fsevents: 2.3.2
|
|
180
|
-
resolution:
|
|
181
|
-
integrity: sha512-1CtEYuS5CRCzFZ7SNW5528SlDlk4VDXIRGwbm/2POQxA/G4+7/crIqJwkmnj8Q/74hGx4oVlNvh4E1CJQ5hZ6w==
|
|
182
|
-
/sade/1.7.4:
|
|
183
|
-
dependencies:
|
|
184
|
-
mri: 1.1.6
|
|
185
|
-
dev: true
|
|
186
|
-
engines:
|
|
187
|
-
node: '>= 6'
|
|
188
|
-
resolution:
|
|
189
|
-
integrity: sha512-y5yauMD93rX840MwUJr7C1ysLFBgMspsdTo4UVrDg3fXDvtwOyIqykhVAAm6fk/3au77773itJStObgK+LKaiA==
|
|
190
|
-
/source-map-js/0.6.2:
|
|
191
|
-
dev: true
|
|
192
|
-
engines:
|
|
193
|
-
node: '>=0.10.0'
|
|
194
|
-
resolution:
|
|
195
|
-
integrity: sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==
|
|
196
|
-
/sourcemap-codec/1.4.8:
|
|
197
|
-
dev: true
|
|
198
|
-
resolution:
|
|
199
|
-
integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==
|
|
200
|
-
/svelte-hmr/0.14.6_svelte@3.38.3:
|
|
201
|
-
dependencies:
|
|
202
|
-
svelte: 3.38.3
|
|
203
|
-
dev: true
|
|
204
|
-
peerDependencies:
|
|
205
|
-
svelte: '>=3.19.0'
|
|
206
|
-
resolution:
|
|
207
|
-
integrity: sha512-0oXQmRiEh3uNjyVQiGmIE7imbKO4dYc1WL6XRXTC0X9XbSacJgj9MOLguqqbZygPsNnlglhlk4eB0pCmM6nQAA==
|
|
208
|
-
/svelte/3.38.3:
|
|
209
|
-
dev: true
|
|
210
|
-
engines:
|
|
211
|
-
node: '>= 8'
|
|
212
|
-
resolution:
|
|
213
|
-
integrity: sha512-N7bBZJH0iF24wsalFZF+fVYMUOigaAUQMIcEKHO3jstK/iL8VmP9xE+P0/a76+FkNcWt+TDv2Gx1taUoUscrvw==
|
|
214
|
-
/vite/2.4.3:
|
|
215
|
-
dependencies:
|
|
216
|
-
esbuild: 0.12.15
|
|
217
|
-
postcss: 8.3.5
|
|
218
|
-
resolve: 1.20.0
|
|
219
|
-
rollup: 2.53.2
|
|
220
|
-
dev: true
|
|
221
|
-
engines:
|
|
222
|
-
node: '>=12.0.0'
|
|
223
|
-
hasBin: true
|
|
224
|
-
optionalDependencies:
|
|
225
|
-
fsevents: 2.3.2
|
|
226
|
-
resolution:
|
|
227
|
-
integrity: sha512-iT6NPeiUUZ2FkzC3eazytOEMRaM4J+xgRQcNcpRcbmfYjakCFP4WKPJpeEz1U5JEKHAtwv3ZBQketQUFhFU3ng==
|
|
228
|
-
specifiers:
|
|
229
|
-
'@sveltejs/kit': next
|
|
230
|
-
svelte: ^3.34.0
|
package/src/app.html
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<link rel="icon" href="/favicon.png" />
|
|
6
|
-
<title>Svelte Mapbox Maps | Developer Documentation</title>
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
8
|
-
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
|
|
9
|
-
<link href="/normalize.css" rel="stylesheet" type="text/css" />
|
|
10
|
-
<link href="/prettify.css" rel="stylesheet" type="text/css" />
|
|
11
|
-
<link href="/style.css" rel="stylesheet" type="text/css" />
|
|
12
|
-
%svelte.head%
|
|
13
|
-
</head>
|
|
14
|
-
<body>
|
|
15
|
-
<div id="svelte">%svelte.body%</div>
|
|
16
|
-
</body>
|
|
17
|
-
</html>
|
package/src/global.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="@sveltejs/kit" />
|
package/src/lib/conf.js
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { getContext } from 'svelte'
|
|
3
|
-
import { contextKey } from '$lib/components.js'
|
|
4
|
-
import MiniScroller from './_MiniScroller.svelte'
|
|
5
|
-
|
|
6
|
-
const { getMap, getMapbox } = getContext(contextKey)
|
|
7
|
-
const map = getMap()
|
|
8
|
-
const mapbox = getMapbox()
|
|
9
|
-
|
|
10
|
-
// Add a new source from our GeoJSON data and set the
|
|
11
|
-
// 'cluster' option to true. GL-JS will add the point_count property to your source data.
|
|
12
|
-
map.addSource('earthquakes', {
|
|
13
|
-
type: 'geojson',
|
|
14
|
-
// Point to GeoJSON data. This example visualizes all M1.0+ earthquakes
|
|
15
|
-
// from 12/22/15 to 1/21/16 as logged by USGS' Earthquake hazards program.
|
|
16
|
-
data: 'https://docs.mapbox.com/mapbox-gl-js/assets/earthquakes.geojson',
|
|
17
|
-
cluster: true,
|
|
18
|
-
clusterMaxZoom: 14, // Max zoom to cluster points on
|
|
19
|
-
clusterRadius: 50 // Radius of each cluster when clustering points (defaults to 50)
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
map.addLayer({
|
|
23
|
-
id: 'clusters',
|
|
24
|
-
type: 'circle',
|
|
25
|
-
source: 'earthquakes',
|
|
26
|
-
filter: [ 'has', 'point_count' ],
|
|
27
|
-
paint: {
|
|
28
|
-
// Use step expressions (https://docs.mapbox.com/mapbox-gl-js/style-spec/#expressions-step)
|
|
29
|
-
// with three steps to implement three types of circles:
|
|
30
|
-
// * Blue, 20px circles when point count is less than 100
|
|
31
|
-
// * Yellow, 30px circles when point count is between 100 and 750
|
|
32
|
-
// * Pink, 40px circles when point count is greater than or equal to 750
|
|
33
|
-
'circle-color': [
|
|
34
|
-
'step',
|
|
35
|
-
[ 'get', 'point_count' ],
|
|
36
|
-
'#51bbd6',
|
|
37
|
-
100,
|
|
38
|
-
'#f1f075',
|
|
39
|
-
750,
|
|
40
|
-
'#f28cb1'
|
|
41
|
-
],
|
|
42
|
-
'circle-radius': [
|
|
43
|
-
'step',
|
|
44
|
-
[ 'get', 'point_count' ],
|
|
45
|
-
20,
|
|
46
|
-
100,
|
|
47
|
-
30,
|
|
48
|
-
750,
|
|
49
|
-
40
|
|
50
|
-
]
|
|
51
|
-
}
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
map.addLayer({
|
|
55
|
-
id: 'cluster-count',
|
|
56
|
-
type: 'symbol',
|
|
57
|
-
source: 'earthquakes',
|
|
58
|
-
filter: [ 'has', 'point_count' ],
|
|
59
|
-
layout: {
|
|
60
|
-
'text-field': '{point_count_abbreviated}',
|
|
61
|
-
'text-font': [ 'DIN Offc Pro Medium', 'Arial Unicode MS Bold' ],
|
|
62
|
-
'text-size': 12
|
|
63
|
-
}
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
map.addLayer({
|
|
67
|
-
id: 'unclustered-point',
|
|
68
|
-
type: 'circle',
|
|
69
|
-
source: 'earthquakes',
|
|
70
|
-
filter: [ '!', [ 'has', 'point_count' ] ],
|
|
71
|
-
paint: {
|
|
72
|
-
'circle-color': '#11b4da',
|
|
73
|
-
'circle-radius': 4,
|
|
74
|
-
'circle-stroke-width': 1,
|
|
75
|
-
'circle-stroke-color': '#fff'
|
|
76
|
-
}
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
map.on('click', 'clusters', function (e) {
|
|
80
|
-
const features = map.queryRenderedFeatures(e.point, {
|
|
81
|
-
layers: [ 'clusters' ]
|
|
82
|
-
})
|
|
83
|
-
const clusterId = features[0].properties.cluster_id
|
|
84
|
-
map.getSource('earthquakes').getClusterExpansionZoom(clusterId, function (err, zoom) {
|
|
85
|
-
if (err) { return }
|
|
86
|
-
|
|
87
|
-
map.easeTo({
|
|
88
|
-
center: features[0].geometry.coordinates,
|
|
89
|
-
zoom: zoom
|
|
90
|
-
})
|
|
91
|
-
})
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
map.on('mouseenter', 'clusters', function () {
|
|
95
|
-
map.getCanvas().style.cursor = 'pointer'
|
|
96
|
-
})
|
|
97
|
-
map.on('mouseleave', 'clusters', function () {
|
|
98
|
-
map.getCanvas().style.cursor = ''
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
map.on('click', 'unclustered-point', function (e) {
|
|
102
|
-
const coordinates = e.features[0].geometry.coordinates.slice()
|
|
103
|
-
|
|
104
|
-
// Ensure that if the map is zoomed out such that multiple
|
|
105
|
-
// copies of the feature are visible, the popup appears
|
|
106
|
-
// over the copy being pointed to.
|
|
107
|
-
while (Math.abs(e.lngLat.lng - coordinates[0]) > 180) {
|
|
108
|
-
coordinates[0] += e.lngLat.lng > coordinates[0] ? 360 : -360
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
map.setCenter(coordinates)
|
|
112
|
-
|
|
113
|
-
new mapbox.Popup({})
|
|
114
|
-
.setLngLat(coordinates)
|
|
115
|
-
.setHTML('<div id="mini-scroller"></div>')
|
|
116
|
-
.addTo(map)
|
|
117
|
-
|
|
118
|
-
new MiniScroller({ target: document.getElementById('mini-scroller'), props: {} }) // eslint-disable-line no-new
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
map.on('mouseenter', 'unclustered-point', function () {
|
|
122
|
-
map.getCanvas().style.cursor = 'pointer'
|
|
123
|
-
})
|
|
124
|
-
|
|
125
|
-
map.on('mouseleave', 'unclustered-point', function () {
|
|
126
|
-
map.getCanvas().style.cursor = ''
|
|
127
|
-
})
|
|
128
|
-
</script>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<h2>hello</h2>
|
package/src/routes/index.svelte
DELETED
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
<header>
|
|
2
|
-
<div class="container">
|
|
3
|
-
<div class="row">
|
|
4
|
-
<div class="col-lg-2 col-xs-12 left">
|
|
5
|
-
<div id="logo">
|
|
6
|
-
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
7
|
-
viewBox="0 0 263.2 127" style="enable-background:new 0 0 263.2 127;" xml:space="preserve">
|
|
8
|
-
<g id="Layer_2_1_">
|
|
9
|
-
<g id="Layer_1-2">
|
|
10
|
-
<path class="st0" d="M263.2,28.5v-5.9h-22.5V0h-5.9v22.5H28.5V0h-5.9v22.5H0v5.9h22.5v70.1H0v5.9h22.5V127h5.9v-22.5h206.4V127
|
|
11
|
-
h5.9v-22.5h22.5v-5.9h-22.5V28.5H263.2z M234.8,98.5H28.5V28.5h206.4V98.5z M50.9,52.2h9.3c1.7-0.1,3.4,0.4,4.7,1.5
|
|
12
|
-
c1.1,1.1,1.7,2.7,1.6,4.3c0,1-0.2,2-0.6,2.8c-0.4,0.8-1.1,1.4-1.9,1.9c0.7,0.1,1.5,0.4,2.1,0.7c0.6,0.3,1,0.7,1.4,1.2
|
|
13
|
-
c0.4,0.5,0.6,1,0.8,1.6c0.2,0.6,0.2,1.3,0.2,1.9c0,1-0.2,1.9-0.6,2.8c-0.4,0.8-0.9,1.5-1.6,2.1c-0.7,0.6-1.5,1-2.4,1.2
|
|
14
|
-
c-1.1,0.3-2.1,0.4-3.2,0.4H51L50.9,52.2z M56.8,61.1h1.7c1.8,0,2.8-0.7,2.8-2.2s-0.9-2.2-2.8-2.2h-1.7V61.1z M56.8,70.2h1.9
|
|
15
|
-
c1.1,0.1,2.2-0.1,3.2-0.6c1-0.7,1.3-2.1,0.5-3.1c-0.1-0.2-0.3-0.4-0.5-0.5c-1-0.5-2.1-0.6-3.2-0.6h-1.9V70.2z M93,57.2h-9.9V61
|
|
16
|
-
h9.6v5h-9.6v3.9H93v5H77.2V52.2H93V57.2z M108.2,65.7l-8.2-13.5h7l4.2,7.3l4.2-7.3h7L114,65.7v9h-5.8V65.7z M126,63.5
|
|
17
|
-
c0-1.6,0.3-3.2,0.9-4.7c1.2-2.9,3.6-5.2,6.5-6.3c3.2-1.2,6.8-1.2,10.1,0c1.5,0.6,2.9,1.4,4,2.5c1.1,1.1,2,2.4,2.5,3.8
|
|
18
|
-
c1.2,3,1.2,6.4,0,9.4c-0.6,1.4-1.5,2.7-2.6,3.8c-1.1,1.1-2.5,2-4,2.5c-3.2,1.2-6.8,1.2-10.1,0c-1.5-0.6-2.8-1.4-3.9-2.5
|
|
19
|
-
c-1.1-1.1-2-2.4-2.6-3.8C126.3,66.7,126,65.1,126,63.5z M132.1,63.5c0,0.9,0.2,1.7,0.5,2.5c0.6,1.5,1.9,2.7,3.4,3.3
|
|
20
|
-
c2.4,1,5.1,0.4,6.9-1.3c0.6-0.6,1.1-1.2,1.4-2c0.7-1.6,0.7-3.4,0-5c-0.3-0.8-0.8-1.4-1.4-2c-1.9-1.7-4.5-2.2-6.9-1.3
|
|
21
|
-
c-1.5,0.6-2.7,1.8-3.4,3.4C132.3,61.8,132.1,62.6,132.1,63.5L132.1,63.5z M158.6,74.8V52.2h5.9L175.3,66V52.2h5.8v22.5h-5.8
|
|
22
|
-
L164.5,61v13.8H158.6z M196.7,61.5l7.1-9.3h7.2l-8.9,10.7l9.8,11.9h-7.6l-7.6-9.8v9.8h-5.9V52.2h5.9V61.5z"/>
|
|
23
|
-
</g>
|
|
24
|
-
</g>
|
|
25
|
-
</svg>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
<div class="col-lg-8 col-md-7 col-xs-12">
|
|
29
|
-
<div class="slogan">
|
|
30
|
-
Svelte MapBox Developer Documentation
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
<div class="col-lg-2 col-md-3 col-xs-12 right">
|
|
34
|
-
<a class="btn" href="http://www.github.com/beyonk-adventures/svelte-mapbox">Github</a>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</header>
|
|
39
|
-
<section class="content">
|
|
40
|
-
<div class="container">
|
|
41
|
-
<div class="content-wrap">
|
|
42
|
-
<div class="row">
|
|
43
|
-
<aside>
|
|
44
|
-
<div class="menu-box">
|
|
45
|
-
<h4>Navigation</h4>
|
|
46
|
-
<nav>
|
|
47
|
-
<ul>
|
|
48
|
-
<li><a href="#geocoder" on:click={() => { navigate('geocoder') } } class:current={page === 'geocoder'}>Geocoder</a></li>
|
|
49
|
-
<li><a href="#map" on:click={() => { navigate('map') }} class:current={page === 'map'}>Map</a></li>
|
|
50
|
-
</ul>
|
|
51
|
-
</nav>
|
|
52
|
-
</div>
|
|
53
|
-
</aside>
|
|
54
|
-
<div class="content-info">
|
|
55
|
-
<div class="action-buttons">
|
|
56
|
-
<button id="fly-to" on:click={flyToRandomPlace}
|
|
57
|
-
>Fly to random location</button
|
|
58
|
-
>
|
|
59
|
-
|
|
60
|
-
<button
|
|
61
|
-
id="change-zoom"
|
|
62
|
-
on:click={() => (zoom = Math.floor(Math.random() * 10))}
|
|
63
|
-
>Change Zoom Level</button
|
|
64
|
-
>
|
|
65
|
-
</div>
|
|
66
|
-
|
|
67
|
-
<div class="section-txt" id="geocoder">
|
|
68
|
-
<form>
|
|
69
|
-
<Geocoder value="(Near London)" accessToken={mapboxToken} on:result={placeChanged} on:clear={() => mapComponent.setCenter({ lng: 0, lat: 0 })} />
|
|
70
|
-
{#if place}
|
|
71
|
-
<dl>
|
|
72
|
-
<dt>Name:</dt>
|
|
73
|
-
<dd>{place.label}</dd>
|
|
74
|
-
<dt>Geolocation:</dt>
|
|
75
|
-
<dd>lat: {place.geometry.lat}, lng: {place.geometry.lng}</dd>
|
|
76
|
-
</dl>
|
|
77
|
-
{/if}
|
|
78
|
-
</form>
|
|
79
|
-
</div>
|
|
80
|
-
<div class="section-txt" id="map">
|
|
81
|
-
<div class="map-wrap">
|
|
82
|
-
<Map
|
|
83
|
-
bind:this={mapComponent}
|
|
84
|
-
accessToken={mapboxToken}
|
|
85
|
-
on:recentre={recentre}
|
|
86
|
-
on:drag={drag}
|
|
87
|
-
{center}
|
|
88
|
-
bind:zoom
|
|
89
|
-
>
|
|
90
|
-
<Earthquakes />
|
|
91
|
-
<NavigationControl />
|
|
92
|
-
<GeolocateControl on:geolocate={e => console.log('geolocated', e.detail)} />
|
|
93
|
-
<Marker lat={marker.lat} lng={marker.lng} />
|
|
94
|
-
</Map>
|
|
95
|
-
</div>
|
|
96
|
-
{#if center}
|
|
97
|
-
<dt>Geolocation:</dt>
|
|
98
|
-
<dd>lat: {center.lat}, lng: {center.lng}</dd>
|
|
99
|
-
<dd>zoom: {zoom}</dd>
|
|
100
|
-
{/if}
|
|
101
|
-
</div>
|
|
102
|
-
</div>
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
105
|
-
</div>
|
|
106
|
-
</section>
|
|
107
|
-
<div class="footer-area">
|
|
108
|
-
<div class="container">
|
|
109
|
-
<div class="row">
|
|
110
|
-
<div class="col-lg-12 center">
|
|
111
|
-
Powered by Beyonk Open Source
|
|
112
|
-
</div>
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
115
|
-
</div>
|
|
116
|
-
<footer>
|
|
117
|
-
<div class="container">
|
|
118
|
-
<div class="row">
|
|
119
|
-
<div class="col-lg-12 center">
|
|
120
|
-
© 2019 Beyonk. All rights reserved.
|
|
121
|
-
</div>
|
|
122
|
-
</div>
|
|
123
|
-
</div>
|
|
124
|
-
</footer>
|
|
125
|
-
|
|
126
|
-
<style>
|
|
127
|
-
:global(#logo svg) {
|
|
128
|
-
fill: white;
|
|
129
|
-
height: 60px;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.slogan {
|
|
133
|
-
margin-top: 14px;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.map-wrap {
|
|
137
|
-
width: 100%;
|
|
138
|
-
height: 300px;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.action-buttons {
|
|
142
|
-
display: flex;
|
|
143
|
-
justify-content: space-between;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
#fly-to,
|
|
147
|
-
#change-zoom {
|
|
148
|
-
display: block;
|
|
149
|
-
position: relative;
|
|
150
|
-
margin: 0px auto;
|
|
151
|
-
height: 40px;
|
|
152
|
-
padding: 10px;
|
|
153
|
-
border: none;
|
|
154
|
-
border-radius: 3px;
|
|
155
|
-
font-size: 12px;
|
|
156
|
-
text-align: center;
|
|
157
|
-
color: #fff;
|
|
158
|
-
background: #ee8a65;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
</style>
|
|
162
|
-
|
|
163
|
-
<script>
|
|
164
|
-
import { mapboxToken } from '$lib/conf.js'
|
|
165
|
-
import { Map, Geocoder, Marker, controls } from '$lib/components.js'
|
|
166
|
-
import Earthquakes from './_Earthquakes.svelte'
|
|
167
|
-
|
|
168
|
-
const { GeolocateControl, NavigationControl } = controls
|
|
169
|
-
const place = null
|
|
170
|
-
|
|
171
|
-
let page = 'about'
|
|
172
|
-
let center = { lat: 53.3358627, lng: -2.8572362 }
|
|
173
|
-
let marker = center
|
|
174
|
-
let zoom = 11.15
|
|
175
|
-
let mapComponent
|
|
176
|
-
|
|
177
|
-
function navigate (next) {
|
|
178
|
-
page = next
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function placeChanged (e) {
|
|
182
|
-
const { result } = e.detail
|
|
183
|
-
mapComponent.setCenter(result.center, 14)
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
function randomLng () {
|
|
187
|
-
return 77 + (Math.random() - 0.5) * 30
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
function randomLat () {
|
|
191
|
-
return 13 + (Math.random() - 0.5) * 30
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function flyToRandomPlace () {
|
|
195
|
-
mapComponent.flyTo({
|
|
196
|
-
center: [
|
|
197
|
-
randomLng(),
|
|
198
|
-
randomLat()
|
|
199
|
-
],
|
|
200
|
-
essential: true
|
|
201
|
-
})
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
function recentre ({ detail }) {
|
|
205
|
-
center = detail.center
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
function drag ({ detail }) {
|
|
209
|
-
marker = detail.center
|
|
210
|
-
}
|
|
211
|
-
</script>
|
package/static/favicon.png
DELETED
|
Binary file
|
package/static/normalize.css
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;}
|
|
2
|
-
body{margin:0;}
|
|
3
|
-
article,
|
|
4
|
-
aside,
|
|
5
|
-
details,
|
|
6
|
-
figcaption,
|
|
7
|
-
figure,
|
|
8
|
-
footer,
|
|
9
|
-
header,
|
|
10
|
-
hgroup,
|
|
11
|
-
main,
|
|
12
|
-
menu,
|
|
13
|
-
nav,
|
|
14
|
-
section,
|
|
15
|
-
summary{display:block;}
|
|
16
|
-
audio,
|
|
17
|
-
canvas,
|
|
18
|
-
progress,
|
|
19
|
-
video{display:inline-block;vertical-align:baseline;}
|
|
20
|
-
audio:not([controls]){display:none;height:0;}
|
|
21
|
-
[hidden],
|
|
22
|
-
template{display:none;}
|
|
23
|
-
a{background-color:transparent;}
|
|
24
|
-
a:active,
|
|
25
|
-
a:hover{outline:0;}
|
|
26
|
-
abbr[title]{border-bottom:1px dotted;}
|
|
27
|
-
b,
|
|
28
|
-
strong{font-weight:bold;}
|
|
29
|
-
dfn{font-style:italic;}
|
|
30
|
-
h1{font-size:2em;margin:0.67em 0;}
|
|
31
|
-
mark{background:#ff0;color:#000;}
|
|
32
|
-
small{font-size:80%;}
|
|
33
|
-
sub,
|
|
34
|
-
sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}
|
|
35
|
-
sup{top:-0.5em;}
|
|
36
|
-
sub{bottom:-0.25em;}
|
|
37
|
-
img{border:0;}
|
|
38
|
-
svg:not(:root){overflow:hidden;}
|
|
39
|
-
figure{margin:1em 40px;}
|
|
40
|
-
hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0;}
|
|
41
|
-
pre{overflow:auto;}
|
|
42
|
-
code,
|
|
43
|
-
kbd,
|
|
44
|
-
pre,
|
|
45
|
-
samp{font-family:monospace, monospace;font-size:1em;}
|
|
46
|
-
button,
|
|
47
|
-
input,
|
|
48
|
-
optgroup,
|
|
49
|
-
select,
|
|
50
|
-
textarea{color:inherit;font:inherit;margin:0;}
|
|
51
|
-
button{overflow:visible;}
|
|
52
|
-
button,
|
|
53
|
-
select{text-transform:none;}
|
|
54
|
-
button,
|
|
55
|
-
html input[type="button"],
|
|
56
|
-
input[type="reset"],
|
|
57
|
-
input[type="submit"]{-webkit-appearance:button;cursor:pointer;}
|
|
58
|
-
button[disabled],
|
|
59
|
-
html input[disabled]{cursor:default;}
|
|
60
|
-
button::-moz-focus-inner,
|
|
61
|
-
input::-moz-focus-inner{border:0;padding:0;}
|
|
62
|
-
input{line-height:normal;}
|
|
63
|
-
input[type="checkbox"],
|
|
64
|
-
input[type="radio"]{box-sizing:border-box;padding:0;}
|
|
65
|
-
input[type="number"]::-webkit-inner-spin-button,
|
|
66
|
-
input[type="number"]::-webkit-outer-spin-button{height:auto;}
|
|
67
|
-
input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}
|
|
68
|
-
input[type="search"]::-webkit-search-cancel-button,
|
|
69
|
-
input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}
|
|
70
|
-
fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em;}
|
|
71
|
-
legend{border:0;padding:0;}
|
|
72
|
-
textarea{overflow:auto;}
|
|
73
|
-
optgroup{font-weight:bold;}
|
|
74
|
-
table{border-collapse:collapse;border-spacing:0;}
|
|
75
|
-
td,
|
|
76
|
-
th{padding:0;}
|