-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathpark.js
More file actions
82 lines (73 loc) · 1.66 KB
/
Copy pathpark.js
File metadata and controls
82 lines (73 loc) · 1.66 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
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
"use strict";
import * as Label from "../constants/label.js";
import * as Color from "../constants/color.js";
const parkLayerFilter = ["!=", ["get", "class"], "aboriginal_lands"];
export const fill = {
id: "protected-area_fill",
filter: parkLayerFilter,
type: "fill",
paint: {
"fill-color": Color.parkFill,
},
source: "openmaptiles",
"source-layer": "park",
};
export const outline = {
id: "protected-area_outline",
filter: parkLayerFilter,
type: "line",
paint: {
"line-color": Color.parkOutline,
},
source: "openmaptiles",
metadata: {},
"source-layer": "park",
};
export const label = {
id: "protected-area_label",
type: "symbol",
filter: ["all", ["has", "rank"], parkLayerFilter],
paint: {
"text-color": Color.parkLabel,
"text-halo-blur": 1,
"text-halo-color": Color.parkLabelHalo,
"text-halo-width": {
base: 1,
stops: [
[10, 1.5],
],
},
},
layout: {
"text-field": Label.localizedName,
"text-font": ["Americana-Regular"],
"text-size": 10,
"symbol-sort-key": ["get", "rank"],
},
source: "openmaptiles",
"source-layer": "park",
};
export const parkFill = {
...fill,
id: "park_fill",
filter: ["==", ["get", "subclass"], "park"],
"source-layer": "landcover",
};
export const parkOutline = {
...outline,
id: "park_outline",
filter: ["==", ["get", "subclass"], "park"],
"source-layer": "landcover",
};
export const parkLabel = {
...label,
id: "park_label",
filter: ["==", ["get", "class"], "park"],
"source-layer": "poi",
};
export const legendEntries = [
{
description: "Park",
layers: [fill.id, outline.id, parkFill.id, parkOutline.id],
},
];