@seamos/map-preset 0.1.0
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/README.md +170 -0
- package/dist/index.cjs +600 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +562 -0
- package/dist/index.js.map +1 -0
- package/package.json +30 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import maplibregl, { StyleSpecification, Map } from 'maplibre-gl';
|
|
2
|
+
|
|
3
|
+
declare const STYLE_PRESETS: {
|
|
4
|
+
readonly basic: StyleSpecification;
|
|
5
|
+
readonly terrain: StyleSpecification;
|
|
6
|
+
};
|
|
7
|
+
type StylePresetName = keyof typeof STYLE_PRESETS;
|
|
8
|
+
|
|
9
|
+
type SeamOSEnv = "dev" | "prod";
|
|
10
|
+
type CreateSeamOSMapOptions = {
|
|
11
|
+
container: string | HTMLElement;
|
|
12
|
+
preset: StylePresetName;
|
|
13
|
+
env: SeamOSEnv;
|
|
14
|
+
maplibre?: Omit<maplibregl.MapOptions, "container" | "style">;
|
|
15
|
+
onLoad?: (map: Map) => void;
|
|
16
|
+
};
|
|
17
|
+
declare function createSeamOSMap(opts: CreateSeamOSMapOptions): maplibregl.Map;
|
|
18
|
+
|
|
19
|
+
export { type CreateSeamOSMapOptions, STYLE_PRESETS, type SeamOSEnv, type StylePresetName, createSeamOSMap };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
// src/createSeamOSMap.ts
|
|
2
|
+
import maplibregl2 from "maplibre-gl";
|
|
3
|
+
|
|
4
|
+
// src/pmtiles/protocol.ts
|
|
5
|
+
import maplibregl from "maplibre-gl";
|
|
6
|
+
import { Protocol } from "pmtiles";
|
|
7
|
+
var installed = false;
|
|
8
|
+
function ensurePmtilesProtocol() {
|
|
9
|
+
if (installed) return;
|
|
10
|
+
const protocol = new Protocol();
|
|
11
|
+
maplibregl.addProtocol("pmtiles", protocol.tile);
|
|
12
|
+
installed = true;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// src/presets/basic.json
|
|
16
|
+
var basic_default = {
|
|
17
|
+
version: 8,
|
|
18
|
+
name: "Korea OMT Lite",
|
|
19
|
+
sources: {
|
|
20
|
+
korea: {
|
|
21
|
+
type: "vector",
|
|
22
|
+
url: "pmtiles://{{PMTILES_BASE}}/korea_v1.0.0.pmtiles"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
layers: [
|
|
26
|
+
{ id: "bg", type: "background", paint: { "background-color": "#94c2e3" } },
|
|
27
|
+
{
|
|
28
|
+
id: "landcover",
|
|
29
|
+
type: "fill",
|
|
30
|
+
source: "korea",
|
|
31
|
+
"source-layer": "landcover",
|
|
32
|
+
paint: { "fill-color": "#d9e8c9", "fill-opacity": 0.8 }
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "landuse",
|
|
36
|
+
type: "fill",
|
|
37
|
+
source: "korea",
|
|
38
|
+
"source-layer": "landuse",
|
|
39
|
+
paint: { "fill-color": "#e4efd7", "fill-opacity": 0.85 }
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: "landuse-farmland",
|
|
43
|
+
type: "fill",
|
|
44
|
+
source: "korea",
|
|
45
|
+
"source-layer": "landcover",
|
|
46
|
+
filter: [
|
|
47
|
+
"any",
|
|
48
|
+
["==", ["get", "class"], "farmland"],
|
|
49
|
+
["==", ["get", "class"], "farm"],
|
|
50
|
+
["==", ["get", "class"], "orchard"],
|
|
51
|
+
["==", ["get", "class"], "vineyard"],
|
|
52
|
+
["==", ["get", "class"], "plant_nursery"],
|
|
53
|
+
["==", ["get", "class"], "greenhouse_horticulture"]
|
|
54
|
+
],
|
|
55
|
+
paint: {
|
|
56
|
+
"fill-color": "#eb5b6c",
|
|
57
|
+
"fill-opacity": 0.9
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: "landuse-paddy",
|
|
62
|
+
type: "fill",
|
|
63
|
+
source: "korea",
|
|
64
|
+
"source-layer": "landcover",
|
|
65
|
+
filter: [
|
|
66
|
+
"any",
|
|
67
|
+
["==", ["get", "class"], "paddy"],
|
|
68
|
+
["==", ["get", "subclass"], "paddy"],
|
|
69
|
+
["==", ["get", "subclass"], "rice"]
|
|
70
|
+
],
|
|
71
|
+
paint: {
|
|
72
|
+
"fill-color": "#c8f0d6",
|
|
73
|
+
"fill-opacity": 0.95
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: "landuse-agri-other",
|
|
78
|
+
type: "fill",
|
|
79
|
+
source: "korea",
|
|
80
|
+
"source-layer": "landcover",
|
|
81
|
+
filter: [
|
|
82
|
+
"any",
|
|
83
|
+
["==", ["get", "class"], "orchard"],
|
|
84
|
+
["==", ["get", "class"], "vineyard"],
|
|
85
|
+
["==", ["get", "class"], "plant_nursery"],
|
|
86
|
+
["==", ["get", "class"], "greenhouse_horticulture"]
|
|
87
|
+
],
|
|
88
|
+
paint: {
|
|
89
|
+
"fill-color": "#f0e9b8",
|
|
90
|
+
"fill-opacity": 0.9
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: "park",
|
|
95
|
+
type: "fill",
|
|
96
|
+
source: "korea",
|
|
97
|
+
"source-layer": "park",
|
|
98
|
+
paint: { "fill-color": "#cfe8b4", "fill-opacity": 0.9 }
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: "water",
|
|
102
|
+
type: "fill",
|
|
103
|
+
source: "korea",
|
|
104
|
+
"source-layer": "water",
|
|
105
|
+
paint: { "fill-color": "#a8d2f0" }
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
id: "waterway",
|
|
109
|
+
type: "line",
|
|
110
|
+
source: "korea",
|
|
111
|
+
"source-layer": "waterway",
|
|
112
|
+
paint: { "line-color": "#7fbbe0", "line-width": ["interpolate", ["linear"], ["zoom"], 8, 0.5, 14, 2.5] }
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
id: "buildings",
|
|
116
|
+
type: "fill",
|
|
117
|
+
source: "korea",
|
|
118
|
+
"source-layer": "building",
|
|
119
|
+
minzoom: 13,
|
|
120
|
+
paint: { "fill-color": "#d7d2cc", "fill-opacity": 0.8 }
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
id: "roads",
|
|
124
|
+
type: "line",
|
|
125
|
+
source: "korea",
|
|
126
|
+
"source-layer": "transportation",
|
|
127
|
+
paint: {
|
|
128
|
+
"line-color": "#ffffff",
|
|
129
|
+
"line-width": ["interpolate", ["linear"], ["zoom"], 6, 0.4, 10, 1.6, 14, 5],
|
|
130
|
+
"line-opacity": 0.95
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
id: "roads-outline",
|
|
135
|
+
type: "line",
|
|
136
|
+
source: "korea",
|
|
137
|
+
"source-layer": "transportation",
|
|
138
|
+
paint: {
|
|
139
|
+
"line-color": "#c9c3bb",
|
|
140
|
+
"line-width": ["interpolate", ["linear"], ["zoom"], 6, 0.8, 10, 2.2, 14, 6],
|
|
141
|
+
"line-opacity": 0.5
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: "place-label",
|
|
146
|
+
type: "symbol",
|
|
147
|
+
source: "korea",
|
|
148
|
+
"source-layer": "place",
|
|
149
|
+
layout: {
|
|
150
|
+
"text-field": ["coalesce", ["get", "name:latin"], ["get", "name"]],
|
|
151
|
+
"text-font": ["Noto Sans Regular"],
|
|
152
|
+
"text-size": ["interpolate", ["linear"], ["zoom"], 5, 10, 12, 14],
|
|
153
|
+
"text-allow-overlap": false
|
|
154
|
+
},
|
|
155
|
+
paint: { "text-color": "#2b2b2b", "text-halo-color": "#ffffff", "text-halo-width": 1.2 }
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: "road-label",
|
|
159
|
+
type: "symbol",
|
|
160
|
+
source: "korea",
|
|
161
|
+
"source-layer": "transportation_name",
|
|
162
|
+
minzoom: 12,
|
|
163
|
+
layout: {
|
|
164
|
+
"symbol-placement": "line",
|
|
165
|
+
"text-field": ["coalesce", ["get", "name:latin"], ["get", "name"], ["get", "ref"]],
|
|
166
|
+
"text-font": ["Noto Sans Regular"],
|
|
167
|
+
"text-size": 11
|
|
168
|
+
},
|
|
169
|
+
paint: { "text-color": "#4b4b4b", "text-halo-color": "#ffffff", "text-halo-width": 1 }
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
// src/presets/terrain.json
|
|
175
|
+
var terrain_default = {
|
|
176
|
+
version: 8,
|
|
177
|
+
name: "Korea Farm Basemap (OMT z<=14 + Terrain z6~12, vivid)",
|
|
178
|
+
sources: {
|
|
179
|
+
korea: {
|
|
180
|
+
type: "vector",
|
|
181
|
+
url: "pmtiles://{{PMTILES_BASE}}/korea_v1.0.0.pmtiles"
|
|
182
|
+
},
|
|
183
|
+
terrain: {
|
|
184
|
+
type: "raster-dem",
|
|
185
|
+
url: "pmtiles://{{PMTILES_BASE}}/korea_terrain_v1.0.0.pmtiles",
|
|
186
|
+
tileSize: 256,
|
|
187
|
+
encoding: "mapbox"
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
terrain: {
|
|
191
|
+
source: "terrain",
|
|
192
|
+
exaggeration: 1.4
|
|
193
|
+
},
|
|
194
|
+
layers: [
|
|
195
|
+
{
|
|
196
|
+
id: "background",
|
|
197
|
+
type: "background",
|
|
198
|
+
paint: {
|
|
199
|
+
"background-color": "#8ab7da"
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
id: "hillshade",
|
|
204
|
+
type: "hillshade",
|
|
205
|
+
source: "terrain",
|
|
206
|
+
paint: {
|
|
207
|
+
"hillshade-shadow-color": "#2b2b2b",
|
|
208
|
+
"hillshade-highlight-color": "#ffffff",
|
|
209
|
+
"hillshade-accent-color": "#9a9a9a",
|
|
210
|
+
"hillshade-exaggeration": 0.35,
|
|
211
|
+
"hillshade-illumination-anchor": "viewport"
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
id: "water-fill",
|
|
216
|
+
type: "fill",
|
|
217
|
+
source: "korea",
|
|
218
|
+
"source-layer": "water",
|
|
219
|
+
paint: {
|
|
220
|
+
"fill-color": "#4fb3ff",
|
|
221
|
+
"fill-opacity": 0.78
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
id: "landcover-base",
|
|
226
|
+
type: "fill",
|
|
227
|
+
source: "korea",
|
|
228
|
+
"source-layer": "landcover",
|
|
229
|
+
paint: {
|
|
230
|
+
"fill-color": [
|
|
231
|
+
"match",
|
|
232
|
+
["get", "class"],
|
|
233
|
+
"wood",
|
|
234
|
+
"#84b07a",
|
|
235
|
+
"grass",
|
|
236
|
+
"#a6cf85",
|
|
237
|
+
"scrub",
|
|
238
|
+
"#9fc27e",
|
|
239
|
+
"wetland",
|
|
240
|
+
"#7fc7ad",
|
|
241
|
+
"#b8d8a7"
|
|
242
|
+
],
|
|
243
|
+
"fill-opacity": 0.2
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
id: "landuse-base",
|
|
248
|
+
type: "fill",
|
|
249
|
+
source: "korea",
|
|
250
|
+
"source-layer": "landuse",
|
|
251
|
+
paint: {
|
|
252
|
+
"fill-color": [
|
|
253
|
+
"match",
|
|
254
|
+
["get", "class"],
|
|
255
|
+
"residential",
|
|
256
|
+
"#e6d3bf",
|
|
257
|
+
"commercial",
|
|
258
|
+
"#e1c2c2",
|
|
259
|
+
"industrial",
|
|
260
|
+
"#d1c8c8",
|
|
261
|
+
"park",
|
|
262
|
+
"#98d28e",
|
|
263
|
+
"cemetery",
|
|
264
|
+
"#9ecaa8",
|
|
265
|
+
"forest",
|
|
266
|
+
"#88b97c",
|
|
267
|
+
"farmland",
|
|
268
|
+
"#bf1d35",
|
|
269
|
+
"farm",
|
|
270
|
+
"#b7ea7a",
|
|
271
|
+
"orchard",
|
|
272
|
+
"#9fe06a",
|
|
273
|
+
"vineyard",
|
|
274
|
+
"#a8df74",
|
|
275
|
+
"#cfe3b2"
|
|
276
|
+
],
|
|
277
|
+
"fill-opacity": 0.9
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
id: "farm-accent",
|
|
282
|
+
type: "fill",
|
|
283
|
+
source: "korea",
|
|
284
|
+
"source-layer": "landcover",
|
|
285
|
+
filter: [
|
|
286
|
+
"any",
|
|
287
|
+
["==", ["get", "class"], "farmland"],
|
|
288
|
+
["==", ["get", "class"], "farm"],
|
|
289
|
+
["==", ["get", "class"], "orchard"],
|
|
290
|
+
["==", ["get", "class"], "vineyard"],
|
|
291
|
+
["==", ["get", "subclass"], "farmland"],
|
|
292
|
+
["==", ["get", "subclass"], "orchard"]
|
|
293
|
+
],
|
|
294
|
+
paint: {
|
|
295
|
+
"fill-color": "#bf1d35",
|
|
296
|
+
"fill-opacity": 0.22
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
id: "waterway-line",
|
|
301
|
+
type: "line",
|
|
302
|
+
source: "korea",
|
|
303
|
+
"source-layer": "waterway",
|
|
304
|
+
paint: {
|
|
305
|
+
"line-color": "#1a7fe0",
|
|
306
|
+
"line-opacity": 0.9,
|
|
307
|
+
"line-width": [
|
|
308
|
+
"interpolate",
|
|
309
|
+
["linear"],
|
|
310
|
+
["zoom"],
|
|
311
|
+
7,
|
|
312
|
+
0.6,
|
|
313
|
+
10,
|
|
314
|
+
1.5,
|
|
315
|
+
12,
|
|
316
|
+
2.4,
|
|
317
|
+
14,
|
|
318
|
+
3.2,
|
|
319
|
+
16,
|
|
320
|
+
4
|
|
321
|
+
]
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
id: "transportation-casing",
|
|
326
|
+
type: "line",
|
|
327
|
+
source: "korea",
|
|
328
|
+
"source-layer": "transportation",
|
|
329
|
+
paint: {
|
|
330
|
+
"line-color": "rgba(0,0,0,0.35)",
|
|
331
|
+
"line-width": [
|
|
332
|
+
"interpolate",
|
|
333
|
+
["linear"],
|
|
334
|
+
["zoom"],
|
|
335
|
+
7,
|
|
336
|
+
1.2,
|
|
337
|
+
10,
|
|
338
|
+
3,
|
|
339
|
+
12,
|
|
340
|
+
4.2,
|
|
341
|
+
14,
|
|
342
|
+
5.4,
|
|
343
|
+
16,
|
|
344
|
+
6.2
|
|
345
|
+
],
|
|
346
|
+
"line-opacity": 0.5
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
id: "transportation-line",
|
|
351
|
+
type: "line",
|
|
352
|
+
source: "korea",
|
|
353
|
+
"source-layer": "transportation",
|
|
354
|
+
paint: {
|
|
355
|
+
"line-color": [
|
|
356
|
+
"match",
|
|
357
|
+
["get", "class"],
|
|
358
|
+
"motorway",
|
|
359
|
+
"#f0b24b",
|
|
360
|
+
"trunk",
|
|
361
|
+
"#f0b24b",
|
|
362
|
+
"primary",
|
|
363
|
+
"#f1c06a",
|
|
364
|
+
"secondary",
|
|
365
|
+
"#f4d28a",
|
|
366
|
+
"tertiary",
|
|
367
|
+
"#f0e0b6",
|
|
368
|
+
"track",
|
|
369
|
+
"#d6c08a",
|
|
370
|
+
"path",
|
|
371
|
+
"#d9d1c3",
|
|
372
|
+
"#f0e0b6"
|
|
373
|
+
],
|
|
374
|
+
"line-opacity": 0.85,
|
|
375
|
+
"line-width": [
|
|
376
|
+
"interpolate",
|
|
377
|
+
["linear"],
|
|
378
|
+
["zoom"],
|
|
379
|
+
7,
|
|
380
|
+
0.7,
|
|
381
|
+
10,
|
|
382
|
+
2,
|
|
383
|
+
12,
|
|
384
|
+
2.8,
|
|
385
|
+
14,
|
|
386
|
+
3.6,
|
|
387
|
+
16,
|
|
388
|
+
4.2
|
|
389
|
+
]
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
id: "landuse-outline-glow",
|
|
394
|
+
type: "line",
|
|
395
|
+
source: "korea",
|
|
396
|
+
"source-layer": "landuse",
|
|
397
|
+
paint: {
|
|
398
|
+
"line-color": "rgba(0,0,0,0.20)",
|
|
399
|
+
"line-opacity": 0.18,
|
|
400
|
+
"line-width": [
|
|
401
|
+
"interpolate",
|
|
402
|
+
["linear"],
|
|
403
|
+
["zoom"],
|
|
404
|
+
8,
|
|
405
|
+
1.2,
|
|
406
|
+
12,
|
|
407
|
+
2.6,
|
|
408
|
+
16,
|
|
409
|
+
4
|
|
410
|
+
]
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
id: "landuse-outline",
|
|
415
|
+
type: "line",
|
|
416
|
+
source: "korea",
|
|
417
|
+
"source-layer": "landuse",
|
|
418
|
+
paint: {
|
|
419
|
+
"line-color": "rgba(255,255,255,0.92)",
|
|
420
|
+
"line-opacity": [
|
|
421
|
+
"interpolate",
|
|
422
|
+
["linear"],
|
|
423
|
+
["zoom"],
|
|
424
|
+
8,
|
|
425
|
+
0.16,
|
|
426
|
+
12,
|
|
427
|
+
0.3,
|
|
428
|
+
16,
|
|
429
|
+
0.42
|
|
430
|
+
],
|
|
431
|
+
"line-width": [
|
|
432
|
+
"interpolate",
|
|
433
|
+
["linear"],
|
|
434
|
+
["zoom"],
|
|
435
|
+
8,
|
|
436
|
+
0.35,
|
|
437
|
+
12,
|
|
438
|
+
0.95,
|
|
439
|
+
16,
|
|
440
|
+
1.4
|
|
441
|
+
]
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
id: "farm-outline",
|
|
446
|
+
type: "line",
|
|
447
|
+
source: "korea",
|
|
448
|
+
"source-layer": "landcover",
|
|
449
|
+
filter: [
|
|
450
|
+
"any",
|
|
451
|
+
["==", ["get", "class"], "farmland"],
|
|
452
|
+
["==", ["get", "class"], "farm"],
|
|
453
|
+
["==", ["get", "class"], "orchard"],
|
|
454
|
+
["==", ["get", "class"], "vineyard"],
|
|
455
|
+
["==", ["get", "subclass"], "farmland"],
|
|
456
|
+
["==", ["get", "subclass"], "orchard"]
|
|
457
|
+
],
|
|
458
|
+
paint: {
|
|
459
|
+
"line-color": "#bf1d35",
|
|
460
|
+
"line-opacity": 0.9,
|
|
461
|
+
"line-width": [
|
|
462
|
+
"interpolate",
|
|
463
|
+
["linear"],
|
|
464
|
+
["zoom"],
|
|
465
|
+
9,
|
|
466
|
+
0.7,
|
|
467
|
+
12,
|
|
468
|
+
1.5,
|
|
469
|
+
16,
|
|
470
|
+
2.4
|
|
471
|
+
]
|
|
472
|
+
}
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
id: "building-fill",
|
|
476
|
+
type: "fill",
|
|
477
|
+
source: "korea",
|
|
478
|
+
"source-layer": "building",
|
|
479
|
+
paint: {
|
|
480
|
+
"fill-color": "#d7d2c9",
|
|
481
|
+
"fill-opacity": 0.6
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
id: "place-label",
|
|
486
|
+
type: "symbol",
|
|
487
|
+
source: "korea",
|
|
488
|
+
"source-layer": "place",
|
|
489
|
+
layout: {
|
|
490
|
+
"text-field": ["coalesce", ["get", "name:latin"], ["get", "name"]],
|
|
491
|
+
"text-font": ["Noto Sans Regular"],
|
|
492
|
+
"text-size": ["interpolate", ["linear"], ["zoom"], 5, 10, 12, 14],
|
|
493
|
+
"text-allow-overlap": false
|
|
494
|
+
},
|
|
495
|
+
paint: { "text-color": "#2b2b2b", "text-halo-color": "#ffffff", "text-halo-width": 1.2 }
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
id: "road-label",
|
|
499
|
+
type: "symbol",
|
|
500
|
+
source: "korea",
|
|
501
|
+
"source-layer": "transportation_name",
|
|
502
|
+
minzoom: 12,
|
|
503
|
+
layout: {
|
|
504
|
+
"symbol-placement": "line",
|
|
505
|
+
"text-field": ["coalesce", ["get", "name:latin"], ["get", "name"], ["get", "ref"]],
|
|
506
|
+
"text-font": ["Noto Sans Regular"],
|
|
507
|
+
"text-size": 11
|
|
508
|
+
},
|
|
509
|
+
paint: { "text-color": "#4b4b4b", "text-halo-color": "#ffffff", "text-halo-width": 1 }
|
|
510
|
+
}
|
|
511
|
+
]
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
// src/presets/index.ts
|
|
515
|
+
var STYLE_PRESETS = {
|
|
516
|
+
basic: basic_default,
|
|
517
|
+
terrain: terrain_default
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
// src/style/resolveStyle.ts
|
|
521
|
+
function deepClone(obj) {
|
|
522
|
+
return JSON.parse(JSON.stringify(obj));
|
|
523
|
+
}
|
|
524
|
+
function replaceTokensInString(s, tokens) {
|
|
525
|
+
let out = s;
|
|
526
|
+
for (const [k, v] of Object.entries(tokens)) {
|
|
527
|
+
out = out.replaceAll(`{{${k}}}`, v);
|
|
528
|
+
}
|
|
529
|
+
return out;
|
|
530
|
+
}
|
|
531
|
+
function deepReplace(obj, tokens) {
|
|
532
|
+
if (typeof obj === "string") return replaceTokensInString(obj, tokens);
|
|
533
|
+
if (Array.isArray(obj)) return obj.map((v) => deepReplace(v, tokens));
|
|
534
|
+
if (obj && typeof obj === "object") {
|
|
535
|
+
const out = {};
|
|
536
|
+
for (const [k, v] of Object.entries(obj)) out[k] = deepReplace(v, tokens);
|
|
537
|
+
return out;
|
|
538
|
+
}
|
|
539
|
+
return obj;
|
|
540
|
+
}
|
|
541
|
+
function resolveStyleTemplate(template, tokens) {
|
|
542
|
+
return deepReplace(deepClone(template), tokens);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
// src/createSeamOSMap.ts
|
|
546
|
+
function createSeamOSMap(opts) {
|
|
547
|
+
ensurePmtilesProtocol();
|
|
548
|
+
let pmtilesBaseUrl = opts.env === "prod" ? "/maps" : "https://seamos-lib.s3.ap-northeast-2.amazonaws.com/pmtiles";
|
|
549
|
+
const template = STYLE_PRESETS[opts.preset];
|
|
550
|
+
const style = resolveStyleTemplate(template, { PMTILES_BASE: pmtilesBaseUrl });
|
|
551
|
+
const map = new maplibregl2.Map({
|
|
552
|
+
container: opts.container,
|
|
553
|
+
style,
|
|
554
|
+
...opts.maplibre
|
|
555
|
+
});
|
|
556
|
+
return map;
|
|
557
|
+
}
|
|
558
|
+
export {
|
|
559
|
+
STYLE_PRESETS,
|
|
560
|
+
createSeamOSMap
|
|
561
|
+
};
|
|
562
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/createSeamOSMap.ts","../src/pmtiles/protocol.ts","../src/presets/basic.json","../src/presets/terrain.json","../src/presets/index.ts","../src/style/resolveStyle.ts"],"sourcesContent":["import maplibregl, { Map } from \"maplibre-gl\";\nimport { ensurePmtilesProtocol } from \"./pmtiles/protocol\";\nimport { STYLE_PRESETS, type StylePresetName } from \"./presets\";\nimport { resolveStyleTemplate } from \"./style/resolveStyle\";\n\nexport type SeamOSEnv = \"dev\" | \"prod\";\n\nexport type CreateSeamOSMapOptions = {\n container: string | HTMLElement;\n preset: StylePresetName;\n env: SeamOSEnv;\n maplibre?: Omit<maplibregl.MapOptions, \"container\" | \"style\">;\n onLoad?: (map: Map) => void;\n};\n\nexport function createSeamOSMap(opts: CreateSeamOSMapOptions) {\n ensurePmtilesProtocol();\n\n let pmtilesBaseUrl = opts.env === 'prod' ? \n \"/maps\"\n : \"https://seamos-lib.s3.ap-northeast-2.amazonaws.com/pmtiles\";\n \n const template = STYLE_PRESETS[opts.preset] as any;\n\n const style = resolveStyleTemplate(template, { PMTILES_BASE: pmtilesBaseUrl });\n\n const map = new maplibregl.Map({\n container: opts.container,\n style,\n ...opts.maplibre,\n });\n\n return map;\n}","import maplibregl from \"maplibre-gl\";\nimport { Protocol } from \"pmtiles\";\n\nlet installed = false;\n\nexport function ensurePmtilesProtocol() {\n if (installed) return;\n\n const protocol = new Protocol();\n maplibregl.addProtocol(\"pmtiles\", protocol.tile);\n \n installed = true;\n}","{\n \"version\": 8,\n \"name\": \"Korea OMT Lite\",\n \"sources\": {\n \"korea\": {\n \"type\": \"vector\",\n \"url\": \"pmtiles://{{PMTILES_BASE}}/korea_v1.0.0.pmtiles\"\n }\n },\n\n \"layers\": [\n { \"id\": \"bg\", \"type\": \"background\", \"paint\": { \"background-color\": \"#94c2e3\" } },\n \n {\n \"id\": \"landcover\",\n \"type\": \"fill\",\n \"source\": \"korea\",\n \"source-layer\": \"landcover\",\n \"paint\": { \"fill-color\": \"#d9e8c9\", \"fill-opacity\": 0.8 }\n },\n {\n \"id\": \"landuse\",\n \"type\": \"fill\",\n \"source\": \"korea\",\n \"source-layer\": \"landuse\",\n \"paint\": { \"fill-color\": \"#e4efd7\", \"fill-opacity\": 0.85 }\n },\n\n {\n \"id\": \"landuse-farmland\",\n \"type\": \"fill\",\n \"source\": \"korea\",\n \"source-layer\": \"landcover\",\n \"filter\": [\"any\",\n [\"==\", [\"get\", \"class\"], \"farmland\"],\n [\"==\", [\"get\", \"class\"], \"farm\"],\n [\"==\", [\"get\", \"class\"], \"orchard\"],\n [\"==\", [\"get\", \"class\"], \"vineyard\"],\n [\"==\", [\"get\", \"class\"], \"plant_nursery\"],\n [\"==\", [\"get\", \"class\"], \"greenhouse_horticulture\"]\n ],\n \"paint\": {\n \"fill-color\": \"#eb5b6c\",\n \"fill-opacity\": 0.9\n }\n },\n\n {\n \"id\": \"landuse-paddy\",\n \"type\": \"fill\",\n \"source\": \"korea\",\n \"source-layer\": \"landcover\",\n \"filter\": [\"any\",\n [\"==\", [\"get\", \"class\"], \"paddy\"],\n [\"==\", [\"get\", \"subclass\"], \"paddy\"],\n [\"==\", [\"get\", \"subclass\"], \"rice\"]\n ],\n \"paint\": {\n \"fill-color\": \"#c8f0d6\",\n \"fill-opacity\": 0.95\n }\n },\n {\n \"id\": \"landuse-agri-other\",\n \"type\": \"fill\",\n \"source\": \"korea\",\n \"source-layer\": \"landcover\",\n \"filter\": [\"any\",\n [\"==\", [\"get\", \"class\"], \"orchard\"],\n [\"==\", [\"get\", \"class\"], \"vineyard\"],\n [\"==\", [\"get\", \"class\"], \"plant_nursery\"],\n [\"==\", [\"get\", \"class\"], \"greenhouse_horticulture\"]\n ],\n \"paint\": {\n \"fill-color\": \"#f0e9b8\",\n \"fill-opacity\": 0.9\n }\n },\n\n {\n \"id\": \"park\",\n \"type\": \"fill\",\n \"source\": \"korea\",\n \"source-layer\": \"park\",\n \"paint\": { \"fill-color\": \"#cfe8b4\", \"fill-opacity\": 0.9 }\n },\n\n {\n \"id\": \"water\",\n \"type\": \"fill\",\n \"source\": \"korea\",\n \"source-layer\": \"water\",\n \"paint\": { \"fill-color\": \"#a8d2f0\" }\n },\n {\n \"id\": \"waterway\",\n \"type\": \"line\",\n \"source\": \"korea\",\n \"source-layer\": \"waterway\",\n \"paint\": { \"line-color\": \"#7fbbe0\", \"line-width\": [\"interpolate\", [\"linear\"], [\"zoom\"], 8, 0.5, 14, 2.5] }\n },\n\n {\n \"id\": \"buildings\",\n \"type\": \"fill\",\n \"source\": \"korea\",\n \"source-layer\": \"building\",\n \"minzoom\": 13,\n \"paint\": { \"fill-color\": \"#d7d2cc\", \"fill-opacity\": 0.8 }\n },\n\n {\n \"id\": \"roads\",\n \"type\": \"line\",\n \"source\": \"korea\",\n \"source-layer\": \"transportation\",\n \"paint\": {\n \"line-color\": \"#ffffff\",\n \"line-width\": [\"interpolate\", [\"linear\"], [\"zoom\"], 6, 0.4, 10, 1.6, 14, 5],\n \"line-opacity\": 0.95\n }\n },\n\n {\n \"id\": \"roads-outline\",\n \"type\": \"line\",\n \"source\": \"korea\",\n \"source-layer\": \"transportation\",\n \"paint\": {\n \"line-color\": \"#c9c3bb\",\n \"line-width\": [\"interpolate\", [\"linear\"], [\"zoom\"], 6, 0.8, 10, 2.2, 14, 6],\n \"line-opacity\": 0.5\n }\n },\n\n {\n \"id\": \"place-label\",\n \"type\": \"symbol\",\n \"source\": \"korea\",\n \"source-layer\": \"place\",\n \"layout\": {\n \"text-field\": [\"coalesce\", [\"get\", \"name:latin\"], [\"get\", \"name\"]],\n \"text-font\": [\"Noto Sans Regular\"],\n \"text-size\": [\"interpolate\", [\"linear\"], [\"zoom\"], 5, 10, 12, 14],\n \"text-allow-overlap\": false\n },\n \"paint\": { \"text-color\": \"#2b2b2b\", \"text-halo-color\": \"#ffffff\", \"text-halo-width\": 1.2 }\n },\n\n {\n \"id\": \"road-label\",\n \"type\": \"symbol\",\n \"source\": \"korea\",\n \"source-layer\": \"transportation_name\",\n \"minzoom\": 12,\n \"layout\": {\n \"symbol-placement\": \"line\",\n \"text-field\": [\"coalesce\", [\"get\", \"name:latin\"], [\"get\", \"name\"], [\"get\", \"ref\"]],\n \"text-font\": [\"Noto Sans Regular\"],\n \"text-size\": 11\n },\n \"paint\": { \"text-color\": \"#4b4b4b\", \"text-halo-color\": \"#ffffff\", \"text-halo-width\": 1.0 }\n }\n ]\n}","{\n \"version\": 8,\n \"name\": \"Korea Farm Basemap (OMT z<=14 + Terrain z6~12, vivid)\",\n \"sources\": {\n \"korea\": {\n \"type\": \"vector\",\n \"url\": \"pmtiles://{{PMTILES_BASE}}/korea_v1.0.0.pmtiles\"\n },\n \"terrain\": {\n \"type\": \"raster-dem\",\n \"url\": \"pmtiles://{{PMTILES_BASE}}/korea_terrain_v1.0.0.pmtiles\",\n \"tileSize\": 256,\n \"encoding\": \"mapbox\"\n }\n },\n \"terrain\": {\n \"source\": \"terrain\",\n \"exaggeration\": 1.4\n },\n \"layers\": [\n {\n \"id\": \"background\",\n \"type\": \"background\",\n \"paint\": {\n \"background-color\": \"#8ab7da\"\n }\n },\n {\n \"id\": \"hillshade\",\n \"type\": \"hillshade\",\n \"source\": \"terrain\",\n \"paint\": {\n \"hillshade-shadow-color\": \"#2b2b2b\",\n \"hillshade-highlight-color\": \"#ffffff\",\n \"hillshade-accent-color\": \"#9a9a9a\",\n \"hillshade-exaggeration\": 0.35,\n \"hillshade-illumination-anchor\": \"viewport\"\n }\n },\n {\n \"id\": \"water-fill\",\n \"type\": \"fill\",\n \"source\": \"korea\",\n \"source-layer\": \"water\",\n \"paint\": {\n \"fill-color\": \"#4fb3ff\",\n \"fill-opacity\": 0.78\n }\n },\n {\n \"id\": \"landcover-base\",\n \"type\": \"fill\",\n \"source\": \"korea\",\n \"source-layer\": \"landcover\",\n \"paint\": {\n \"fill-color\": [\n \"match\",\n [\"get\", \"class\"],\n \"wood\",\n \"#84b07a\",\n \"grass\",\n \"#a6cf85\",\n \"scrub\",\n \"#9fc27e\",\n \"wetland\",\n \"#7fc7ad\",\n \"#b8d8a7\"\n ],\n \"fill-opacity\": 0.20\n }\n },\n {\n \"id\": \"landuse-base\",\n \"type\": \"fill\",\n \"source\": \"korea\",\n \"source-layer\": \"landuse\",\n \"paint\": {\n \"fill-color\": [\n \"match\",\n [\"get\", \"class\"],\n \"residential\",\n \"#e6d3bf\",\n \"commercial\",\n \"#e1c2c2\",\n \"industrial\",\n \"#d1c8c8\",\n \"park\",\n \"#98d28e\",\n \"cemetery\",\n \"#9ecaa8\",\n \"forest\",\n \"#88b97c\",\n \"farmland\",\n \"#bf1d35\",\n \"farm\",\n \"#b7ea7a\",\n \"orchard\",\n \"#9fe06a\",\n \"vineyard\",\n \"#a8df74\",\n \"#cfe3b2\"\n ],\n \"fill-opacity\": 0.90\n }\n },\n {\n \"id\": \"farm-accent\",\n \"type\": \"fill\",\n \"source\": \"korea\",\n \"source-layer\": \"landcover\",\n \"filter\": [\n \"any\",\n [\"==\", [\"get\", \"class\"], \"farmland\"],\n [\"==\", [\"get\", \"class\"], \"farm\"],\n [\"==\", [\"get\", \"class\"], \"orchard\"],\n [\"==\", [\"get\", \"class\"], \"vineyard\"],\n [\"==\", [\"get\", \"subclass\"], \"farmland\"],\n [\"==\", [\"get\", \"subclass\"], \"orchard\"]\n ],\n \"paint\": {\n \"fill-color\": \"#bf1d35\",\n \"fill-opacity\": 0.22\n }\n },\n {\n \"id\": \"waterway-line\",\n \"type\": \"line\",\n \"source\": \"korea\",\n \"source-layer\": \"waterway\",\n \"paint\": {\n \"line-color\": \"#1a7fe0\",\n \"line-opacity\": 0.9,\n \"line-width\": [\n \"interpolate\",\n [\"linear\"],\n [\"zoom\"],\n 7,\n 0.6,\n 10,\n 1.5,\n 12,\n 2.4,\n 14,\n 3.2,\n 16,\n 4.0\n ]\n }\n },\n {\n \"id\": \"transportation-casing\",\n \"type\": \"line\",\n \"source\": \"korea\",\n \"source-layer\": \"transportation\",\n \"paint\": {\n \"line-color\": \"rgba(0,0,0,0.35)\",\n \"line-width\": [\n \"interpolate\",\n [\"linear\"],\n [\"zoom\"],\n 7,\n 1.2,\n 10,\n 3.0,\n 12,\n 4.2,\n 14,\n 5.4,\n 16,\n 6.2\n ],\n \"line-opacity\": 0.5\n }\n },\n {\n \"id\": \"transportation-line\",\n \"type\": \"line\",\n \"source\": \"korea\",\n \"source-layer\": \"transportation\",\n \"paint\": {\n \"line-color\": [\n \"match\",\n [\"get\", \"class\"],\n \"motorway\",\n \"#f0b24b\",\n \"trunk\",\n \"#f0b24b\",\n \"primary\",\n \"#f1c06a\",\n \"secondary\",\n \"#f4d28a\",\n \"tertiary\",\n \"#f0e0b6\",\n \"track\",\n \"#d6c08a\",\n \"path\",\n \"#d9d1c3\",\n \"#f0e0b6\"\n ],\n \"line-opacity\": 0.85,\n \"line-width\": [\n \"interpolate\",\n [\"linear\"],\n [\"zoom\"],\n 7,\n 0.7,\n 10,\n 2.0,\n 12,\n 2.8,\n 14,\n 3.6,\n 16,\n 4.2\n ]\n }\n },\n {\n \"id\": \"landuse-outline-glow\",\n \"type\": \"line\",\n \"source\": \"korea\",\n \"source-layer\": \"landuse\",\n \"paint\": {\n \"line-color\": \"rgba(0,0,0,0.20)\",\n \"line-opacity\": 0.18,\n \"line-width\": [\n \"interpolate\",\n [\"linear\"],\n [\"zoom\"],\n 8,\n 1.2,\n 12,\n 2.6,\n 16,\n 4.0\n ]\n }\n },\n {\n \"id\": \"landuse-outline\",\n \"type\": \"line\",\n \"source\": \"korea\",\n \"source-layer\": \"landuse\",\n \"paint\": {\n \"line-color\": \"rgba(255,255,255,0.92)\",\n \"line-opacity\": [\n \"interpolate\",\n [\"linear\"],\n [\"zoom\"],\n 8,\n 0.16,\n 12,\n 0.30,\n 16,\n 0.42\n ],\n \"line-width\": [\n \"interpolate\",\n [\"linear\"],\n [\"zoom\"],\n 8,\n 0.35,\n 12,\n 0.95,\n 16,\n 1.4\n ]\n }\n },\n {\n \"id\": \"farm-outline\",\n \"type\": \"line\",\n \"source\": \"korea\",\n \"source-layer\": \"landcover\",\n \"filter\": [\n \"any\",\n [\"==\", [\"get\", \"class\"], \"farmland\"],\n [\"==\", [\"get\", \"class\"], \"farm\"],\n [\"==\", [\"get\", \"class\"], \"orchard\"],\n [\"==\", [\"get\", \"class\"], \"vineyard\"],\n [\"==\", [\"get\", \"subclass\"], \"farmland\"],\n [\"==\", [\"get\", \"subclass\"], \"orchard\"]\n ],\n \"paint\": {\n \"line-color\": \"#bf1d35\",\n \"line-opacity\": 0.9,\n \"line-width\": [\n \"interpolate\",\n [\"linear\"],\n [\"zoom\"],\n 9,\n 0.7,\n 12,\n 1.5,\n 16,\n 2.4\n ]\n }\n },\n {\n \"id\": \"building-fill\",\n \"type\": \"fill\",\n \"source\": \"korea\",\n \"source-layer\": \"building\",\n \"paint\": {\n \"fill-color\": \"#d7d2c9\",\n \"fill-opacity\": 0.6\n }\n },\n\n {\n \"id\": \"place-label\",\n \"type\": \"symbol\",\n \"source\": \"korea\",\n \"source-layer\": \"place\",\n \"layout\": {\n \"text-field\": [\"coalesce\", [\"get\", \"name:latin\"], [\"get\", \"name\"]],\n \"text-font\": [\"Noto Sans Regular\"],\n \"text-size\": [\"interpolate\", [\"linear\"], [\"zoom\"], 5, 10, 12, 14],\n \"text-allow-overlap\": false\n },\n \"paint\": { \"text-color\": \"#2b2b2b\", \"text-halo-color\": \"#ffffff\", \"text-halo-width\": 1.2 }\n },\n\n {\n \"id\": \"road-label\",\n \"type\": \"symbol\",\n \"source\": \"korea\",\n \"source-layer\": \"transportation_name\",\n \"minzoom\": 12,\n \"layout\": {\n \"symbol-placement\": \"line\",\n \"text-field\": [\"coalesce\", [\"get\", \"name:latin\"], [\"get\", \"name\"], [\"get\", \"ref\"]],\n \"text-font\": [\"Noto Sans Regular\"],\n \"text-size\": 11\n },\n \"paint\": { \"text-color\": \"#4b4b4b\", \"text-halo-color\": \"#ffffff\", \"text-halo-width\": 1.0 }\n }\n ]\n}","import type { StyleSpecification } from \"maplibre-gl\";\nimport basic from \"./basic.json\";\nimport terrain from \"./terrain.json\";\n\nexport const STYLE_PRESETS = {\n basic: basic as StyleSpecification,\n terrain: terrain as StyleSpecification\n} as const;\n\nexport type StylePresetName = keyof typeof STYLE_PRESETS;","import type { StyleSpecification } from \"maplibre-gl\";\n\nfunction deepClone<T>(obj: T): T {\n return JSON.parse(JSON.stringify(obj));\n}\n\nfunction replaceTokensInString(s: string, tokens: Record<string, string>) {\n let out = s;\n for (const [k, v] of Object.entries(tokens)) {\n out = out.replaceAll(`{{${k}}}`, v);\n }\n\n return out;\n}\n\nfunction deepReplace(obj: any, tokens: Record<string, string>): any {\n if (typeof obj === \"string\") return replaceTokensInString(obj, tokens);\n if (Array.isArray(obj)) return obj.map((v) => deepReplace(v, tokens));\n if (obj && typeof obj === \"object\") {\n const out: any = {};\n for (const [k, v] of Object.entries(obj)) out[k] = deepReplace(v, tokens);\n \n return out;\n }\n\n return obj;\n}\n\nexport function resolveStyleTemplate(\n template: StyleSpecification,\n tokens: Record<string, string>\n): StyleSpecification {\n return deepReplace(deepClone(template), tokens) as StyleSpecification;\n}"],"mappings":";AAAA,OAAOA,iBAAyB;;;ACAhC,OAAO,gBAAgB;AACvB,SAAS,gBAAgB;AAEzB,IAAI,YAAY;AAET,SAAS,wBAAwB;AACpC,MAAI,UAAW;AAEf,QAAM,WAAW,IAAI,S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,GAAG;AACzC,UAAM,IAAI,WAAW,KAAK,CAAC,MAAM,CAAC;AAAA,EACtC;AAEA,SAAO;AACX;AAEA,SAAS,YAAY,KAAU,QAAqC;AAChE,MAAI,OAAO,QAAQ,SAAU,QAAO,sBAAsB,KAAK,MAAM;AACrE,MAAI,MAAM,QAAQ,GAAG,EAAG,QAAO,IAAI,IAAI,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC;AACpE,MAAI,OAAO,OAAO,QAAQ,UAAU;AAChC,UAAM,MAAW,CAAC;AAClB,eAAW,CAAC,GAAG,CAAC,KAAK,OAAO,QAAQ,GAAG,EAAG,KAAI,CAAC,IAAI,YAAY,GAAG,MAAM;AAExE,WAAO;AAAA,EACX;AAEA,SAAO;AACX;AAEO,SAAS,qBACZ,UACA,QACkB;AAClB,SAAO,YAAY,UAAU,QAAQ,GAAG,MAAM;AAClD;;;ALlBO,SAAS,gBAAgB,MAA8B;AAC1D,wBAAsB;AAEtB,MAAI,iBAAiB,KAAK,QAAQ,SAC9B,UACE;AAEN,QAAM,WAAW,cAAc,KAAK,MAAM;AAE1C,QAAM,QAAQ,qBAAqB,UAAU,EAAE,cAAc,eAAe,CAAC;AAE7E,QAAM,MAAM,IAAIC,YAAW,IAAI;AAAA,IAC3B,WAAW,KAAK;AAAA,IAChB;AAAA,IACA,GAAG,KAAK;AAAA,EACZ,CAAC;AAED,SAAO;AACX;","names":["maplibregl","maplibregl"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@seamos/map-preset",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Simple Preset for map(Maplibre) when you development SeamOS application.",
|
|
5
|
+
"private": false,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.cjs",
|
|
8
|
+
"module": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"files": ["dist"],
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"author": "Sungmin Cho",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsup",
|
|
16
|
+
"dev": "tsup --watch",
|
|
17
|
+
"typecheck": "tsc --noEmit"
|
|
18
|
+
},
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"maplibre-gl": "^4 || ^5",
|
|
21
|
+
"pmtiles": "^3"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/node": "^22.0.0",
|
|
25
|
+
"maplibre-gl": "^5.0.0",
|
|
26
|
+
"pmtiles": "^3.0.0",
|
|
27
|
+
"tsup": "^8.0.0",
|
|
28
|
+
"typescript": "^5.0.0"
|
|
29
|
+
}
|
|
30
|
+
}
|