-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
104 lines (101 loc) · 3.08 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
const bathy = {
"version": 8,
"sources": {
"hs_tory": {
"type": "raster",
"tiles": ["https://tile-service-raster.s3.us-east-1.amazonaws.com/tiles/base-bathy/{z}/{x}/{y}.png"],
"bounds": [-178.826516,-52.620881,179.067794,-29.231342],
"scheme": "xyz",
"tileSize": 256,
"attribution": "Mine!",
"maxzoom": 18
},
"hs_nz": {
"type": "raster",
"tiles": ["https://tile-service-raster.s3.us-east-1.amazonaws.com/tiles/hs-nz/{z}/{x}/{y}.png"],
"bounds": [-178.826516,-52.620881,179.067794,-29.231342],
"scheme": "tms",
"tileSize": 256,
"attribution": "Mine!",
"maxzoom": 18
},
"hs_raster": {
"type": "raster",
"tiles": ["https://tile-service-raster.s3.us-east-1.amazonaws.com/tiles/marlborough-tiles/{z}/{x}/{y}.png"],
"bounds": [-178.826516,-52.620881,179.067794,-29.231342],
"scheme": "xyz",
"tileSize": 256,
"attribution": "Mine!",
"maxzoom": 18
}
},
"layers":[
{
"id": "hs_tory",
"source": "hs_tory",
"type": "raster",
"layout": { "visibility": "visible" },
"paint": {
"raster-resampling": "linear",
"raster-opacity": 1.0,
}
},
{
"id": "hs_nz",
"source": "hs_nz",
"type": "raster",
"layout": { "visibility": "visible" },
"paint": {
"raster-opacity": 0.75,
"raster-resampling": "linear",
"raster-brightness-max": 1.0,
"raster-brightness-min": 0.5,
"raster-contrast": 0,
"raster-opacity": {
"stops": [
[1, 0.35],
[7, 0.35],
[8, 0.65],
[15, 0.65],
[16, 0.3]
]
},
}
},
{
"id": "hs_raster",
"source": "hs_raster",
"type": "raster",
"layout": { "visibility": "visible" },
"paint": {
"raster-opacity": 0.75,
"raster-resampling": "linear",
"raster-brightness-max": 1.0,
"raster-brightness-min": 0.5,
"raster-contrast": 0,
"raster-opacity": {
"stops": [
[1, 0.35],
[7, 0.35],
[8, 0.65],
[15, 0.65],
[16, 0.3]
]
},
}
}
]
}
const map = new maplibregl.Map({
container: 'map',
style: bathy,
"center": [174.0,-41.29],
"zoom": 9,
});
const mapOverlay = new maplibregl.Map({
container: 'mapOverlay',
style: 'style/style.json',
"center": [174.0,-41.29],
"zoom": 9,
});
syncMaps(map, mapOverlay);