-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample-map.js
156 lines (156 loc) · 4.56 KB
/
sample-map.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
$(function() {
mapboxgl.accessToken = "pk.eyJ1IjoibWFwbWVsZCIsImEiOiI0a1NzYW53In0.2gQTd6k9Ghw8UBK4DsciLA";
var map = new mapboxgl.Map({
container: 'map',
center: [-73.26, 42.786],
zoom: 6,
style: {
"version": 8,
"sprite": spriteID,
"glyphs": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf",
"sources": {
"mapbox": {
"type": "vector",
"url": "mapbox://mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v6"
}
},
"layers": [
{
"id": "background",
"paint": {
"background-color": "#444"
},
"layout": {
"visibility": "visible"
},
"type": "background"
}, {
"id": "landcover_snow",
"source": "mapbox",
"source-layer": "landcover",
"filter": ["==", "class", "snow" ],
"paint": { "fill-pattern": "snow", "fill-opacity": 1 },
"type": "fill"
},
{
"id": "landcover_crop",
"source": "mapbox",
"source-layer": "landcover",
"filter": ["==", "class", "crop" ],
"paint": { "fill-pattern": "farm", "fill-opacity": 1 },
"type": "fill"
}, {
"id": "landcover_grass",
"source": "mapbox",
"source-layer": "landcover",
"filter": ["==", "class", "grass" ],
"paint": { "fill-pattern": "grass", "fill-opacity": 1 },
"type": "fill"
}, {
"id": "landcover_wood",
"source": "mapbox",
"source-layer": "landcover",
"filter": ["==", "class", "wood" ],
"paint": { "fill-pattern": "wood", "fill-opacity": 1 },
"type": "fill"
}, {
"id": "landuse_wood",
"source": "mapbox",
"source-layer": "landuse",
"filter": ["==", "class", "wood" ],
"paint": { "fill-pattern": "wood", "fill-opacity": 1 },
"type": "fill"
}, {
"id": "water",
"source": "mapbox",
"source-layer": "water",
"paint": {
"fill-pattern": "water",
"fill-outline-color": "#a2bdc0"
},
"type": "fill"
},
{
"id": "landuse_park",
"source": "mapbox",
"source-layer": "landuse",
"filter": ["==", "class", "park" ],
"paint": { "fill-pattern": "grass", "fill-opacity": 1 },
"type": "fill"
},
{
"id": "landuse_industrial",
"source": "mapbox",
"source-layer": "landuse",
"filter": ["==", "class", "industrial" ],
"paint": { "fill-pattern": "urban" },
"type": "fill"
},
{
"id": "residential",
"source": "mapbox",
"source-layer": "landuse",
"filter": ["==", "class", "residential" ],
"paint": { "fill-pattern": "urban" },
"type": "fill"
},
{
"id": "building",
"source": "mapbox",
"source-layer": "building",
"paint": { "fill-pattern": "urban" },
"type": "fill"
},
{
"id": "commercial",
"source": "mapbox",
"source-layer": "landuse",
"filter": ["==", "class", "commercial" ],
"paint": { "fill-pattern": "urban" },
"type": "fill"
},
{
"id": "landuse_grass",
"source": "mapbox",
"source-layer": "landuse",
"filter": ["==", "class", "grass" ],
"paint": { "fill-pattern": "grass" },
"type": "fill"
},
{
"id": "landuse_sand",
"source": "mapbox",
"source-layer": "landuse",
"filter": ["==", "class", "sand" ],
"paint": { "fill-pattern": "sand" },
"type": "fill"
},
{
"id": "landuse_crop",
"source": "mapbox",
"source-layer": "landuse",
"filter": ["==", "class", "crop" ],
"paint": { "fill-pattern": "farm" },
"type": "fill"
},
{
"id": "landuse_rock",
"source": "mapbox",
"source-layer": "landuse",
"filter": ["==", "class", "rock" ],
"paint": { "fill-pattern": "rock" },
"type": "fill"
},
{
"id": "landuse_snow",
"source": "mapbox",
"source-layer": "landuse",
"filter": ["==", "class", "snow" ],
"paint": { "fill-pattern": "snow" },
"type": "fill"
}
]
},
hash: true
});
});