generated from EsriDevEvents/ds-2024-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
5-unique-value-renderer-blendmode.html
170 lines (161 loc) · 4.47 KB
/
5-unique-value-renderer-blendmode.html
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="initial-scale=1,maximum-scale=1,user-scalable=no"
/>
<title>
5-unique-value-renderer-blendmode
</title>
<link
rel="stylesheet"
type="text/css"
href="https://js.arcgis.com/calcite-components/1.0.7/calcite.css"
/>
<script
type="module"
src="https://js.arcgis.com/calcite-components/1.0.7/calcite.esm.js"
></script>
<link
rel="stylesheet"
href="https://js.arcgis.com/4.26/esri/themes/light/main.css"
/>
<script src="https://js.arcgis.com/4.26/"></script>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<script>
require([
"esri/WebMap",
"esri/views/MapView",
"esri/layers/ImageryLayer",
"esri/layers/VectorTileLayer",
"esri/layers/FeatureLayer",
"esri/renderers/SimpleRenderer",
"esri/renderers/UniqueValueRenderer",
"esri/symbols/SimpleFillSymbol",
"esri/widgets/Swipe",
], (
WebMap,
MapView,
ImageryLayer,
VectorTileLayer,
FeatureLayer,
SimpleRenderer, UniqueValueRenderer,
SimpleFillSymbol,
Swipe
) => {
const noEffectImageryLayer = new ImageryLayer({
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/NLCDLandCover2001/ImageServer",
});
const effectImageryLayer = new ImageryLayer({
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/NLCDLandCover2001/ImageServer",
effect: [
{
scale: 5_000_000,
value: "drop-shadow(1px 1px 2px black) bloom(2 0 0.5)",
},
{
scale: 2_000_000,
value:
"drop-shadow(0px 0px 0px #ff5722) bloom(0.1 0 0.5) grayscale(0.4)",
},
],
renderer: new UniqueValueRenderer({
field: "Value",
uniqueValueInfos: [
{
value: 24,
label: "Developed, High Intensity",
symbol: new SimpleFillSymbol({
color: "#ffeb3b",
}),
},
{
value: 23,
label: "Developed, Medium Intensity",
symbol: new SimpleFillSymbol({
color: "#ffc107",
}),
},
{
value: 22,
label: "Developed, Low Intensity",
symbol: new SimpleFillSymbol({
color: "#ff9800",
}),
},
],
}),
});
map = new WebMap({
basemap: {
baseLayers: [
new VectorTileLayer({
portalItem: {
id: "bc83b1329cac47ffbd7f70e734be9083",
},
}),
new FeatureLayer({
portalItem: {
id: "28da9fa638b74fb295cc07008ef2f14a",
},
renderer: new SimpleRenderer({
symbol: new SimpleFillSymbol({
style: "none",
outline: {
type: "simple-line",
color: "#282828",
},
}),
}),
}),
],
},
layers: [noEffectImageryLayer, effectImageryLayer],
});
view = new MapView({
container: "viewDiv",
map,
extent: {
spatialReference: {
wkid: 102003,
},
xmax: 1874643.2331984383,
xmin: -2268085.08383833,
ymax: 1306570.485845424,
ymin: -962852.3969934431,
},
constraints: {
snapToZoom: false,
minScale: 45_000_000,
},
});
var swipe = new Swipe({
view: view,
leadingLayers: [noEffectImageryLayer],
trailingLayers: [effectImageryLayer],
direction: "horizontal",
position: 100,
});
view.ui.add(swipe);
});
</script>
</head>
<body>
<calcite-panel heading="UniqueValueRenderer">
<div
style="padding: 0; margin: 0; height: 100%; width: 100%;"
id="viewDiv"
></div>
</calcite-shell>
</body>
</html>