-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathindex.html
More file actions
42 lines (42 loc) · 1.14 KB
/
Copy pathindex.html
File metadata and controls
42 lines (42 loc) · 1.14 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>zarr-gl basic example</title>
<meta property="og:description" content="Basic no-build zarr-gl example" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@4.7.1/dist/maplibre-gl.css" />
<script src="https://unpkg.com/maplibre-gl@4.7.1/dist/maplibre-gl.js"></script>
<style>
body { margin: 0; padding: 0; }
html, body, #map { height: 100%; }
</style>
</head>
<body>
<div id="map"></div>
<script type="module">
import { ZarrLayer } from "https://cdn.jsdelivr.net/npm/zarr-gl@0.3.0/dist/zarr-gl.js/+esm";
const map = new maplibregl.Map({
container: "map",
style: "https://demotiles.maplibre.org/style.json",
center: [0, 0],
zoom: 3,
renderWorldCopies: false,
});
const layer = new ZarrLayer({
map,
id: "my-layer",
source: "./example.zarr",
variable: "my_array",
colormap: [[200, 10, 50], [30, 40, 30], [50, 10, 200]],
vmin: 20,
vmax: 300,
opacity: 0.8,
invalidate: () => map.triggerRepaint(),
});
map.on("load", () => {
map.addLayer(layer);
});
</script>
</body>
</html>