-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathselect_style.html
More file actions
28 lines (24 loc) · 803 Bytes
/
select_style.html
File metadata and controls
28 lines (24 loc) · 803 Bytes
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
<div id="map" style="height: 100%; width: 100%"></div>
<script src="../../dist/gridviz.js"></script>
<script>
//define map with initial view
const map = new gridviz.Map(document.getElementById('map'), {
x: 4200000,
y: 2600000,
z: 300,
backgroundColor: '#EADDCA',
}).addZoomButtons()
//define dataset
const dataset = new gridviz.TiledGrid(
map,
'https://raw.githubusercontent.com/jgaffuri/tiledgrids/main/data/europe/clc/500m/'
)
//define color style
const style = new gridviz.SquareColorCategoryWebGLStyle({
code: (cell) => cell.clc,
color: { 41: '#1ca3ec' },
filter: (cell) => cell.clc == '41',
})
//add layer to map
map.layers = [new gridviz.GridLayer(dataset, [style])]
</script>