@saschabrunnerch/arcgis-maps-sdk-js-ai-context 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +163 -203
- package/bin/cli.js +157 -173
- package/contexts/4.34/{claude → skills}/arcgis-3d-advanced/SKILL.md +586 -586
- package/contexts/4.34/{claude → skills}/arcgis-advanced-layers/SKILL.md +431 -431
- package/contexts/4.34/{claude → skills}/arcgis-analysis-services/SKILL.md +607 -607
- package/contexts/4.34/{claude → skills}/arcgis-authentication/SKILL.md +301 -301
- package/contexts/4.34/{claude → skills}/arcgis-cim-symbols/SKILL.md +486 -486
- package/contexts/4.34/{claude → skills}/arcgis-coordinates-projection/SKILL.md +406 -406
- package/contexts/4.34/{claude → skills}/arcgis-core-maps/SKILL.md +739 -739
- package/contexts/4.34/{claude → skills}/arcgis-core-utilities/SKILL.md +732 -732
- package/contexts/4.34/{claude → skills}/arcgis-custom-rendering/SKILL.md +445 -445
- package/contexts/4.34/{claude → skills}/arcgis-editing-advanced/SKILL.md +702 -702
- package/contexts/4.34/{claude → skills}/arcgis-feature-effects/SKILL.md +393 -393
- package/contexts/4.34/{claude → skills}/arcgis-geometry-operations/SKILL.md +489 -489
- package/contexts/4.34/{claude → skills}/arcgis-imagery/SKILL.md +307 -307
- package/contexts/4.34/{claude → skills}/arcgis-interaction/SKILL.md +572 -572
- package/contexts/4.34/{claude → skills}/arcgis-knowledge-graphs/SKILL.md +582 -582
- package/contexts/4.34/{claude → skills}/arcgis-layers/SKILL.md +601 -601
- package/contexts/4.34/{claude → skills}/arcgis-map-tools/SKILL.md +668 -668
- package/contexts/4.34/{claude → skills}/arcgis-media-layers/SKILL.md +290 -290
- package/contexts/4.34/{claude → skills}/arcgis-portal-content/SKILL.md +679 -679
- package/contexts/4.34/{claude → skills}/arcgis-scene-effects/SKILL.md +512 -512
- package/contexts/4.34/{claude → skills}/arcgis-smart-mapping/SKILL.md +686 -686
- package/contexts/4.34/{claude → skills}/arcgis-starter-app-extended/SKILL.md +649 -649
- package/contexts/4.34/{claude → skills}/arcgis-tables-forms/SKILL.md +877 -877
- package/contexts/4.34/{claude → skills}/arcgis-time-animation/SKILL.md +722 -722
- package/contexts/4.34/{claude → skills}/arcgis-utility-networks/SKILL.md +301 -301
- package/contexts/4.34/{claude → skills}/arcgis-visualization/SKILL.md +580 -580
- package/contexts/4.34/{claude → skills}/arcgis-widgets-ui/SKILL.md +574 -574
- package/lib/installer.js +19 -104
- package/package.json +45 -45
- package/contexts/4.34/copilot/arcgis-3d.instructions.md +0 -267
- package/contexts/4.34/copilot/arcgis-analysis.instructions.md +0 -294
- package/contexts/4.34/copilot/arcgis-arcade.instructions.md +0 -234
- package/contexts/4.34/copilot/arcgis-authentication.instructions.md +0 -187
- package/contexts/4.34/copilot/arcgis-cim-symbols.instructions.md +0 -177
- package/contexts/4.34/copilot/arcgis-core-maps.instructions.md +0 -246
- package/contexts/4.34/copilot/arcgis-core-utilities.instructions.md +0 -247
- package/contexts/4.34/copilot/arcgis-editing.instructions.md +0 -262
- package/contexts/4.34/copilot/arcgis-geometry.instructions.md +0 -225
- package/contexts/4.34/copilot/arcgis-layers.instructions.md +0 -278
- package/contexts/4.34/copilot/arcgis-popup-templates.instructions.md +0 -266
- package/contexts/4.34/copilot/arcgis-portal-advanced.instructions.md +0 -275
- package/contexts/4.34/copilot/arcgis-smart-mapping.instructions.md +0 -184
- package/contexts/4.34/copilot/arcgis-starter-app-extended.instructions.md +0 -643
- package/contexts/4.34/copilot/arcgis-starter-app.instructions.md +0 -268
- package/contexts/4.34/copilot/arcgis-time-animation.instructions.md +0 -112
- package/contexts/4.34/copilot/arcgis-visualization.instructions.md +0 -321
- package/contexts/4.34/copilot/arcgis-widgets-ui.instructions.md +0 -277
- /package/contexts/4.34/{claude → skills}/arcgis-arcade/SKILL.md +0 -0
- /package/contexts/4.34/{claude → skills}/arcgis-popup-templates/SKILL.md +0 -0
- /package/contexts/4.34/{claude → skills}/arcgis-starter-app/SKILL.md +0 -0
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
applyTo: "**/*.{js,ts,jsx,tsx,html,json}"
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# ArcGIS Starter App with TypeScript & Vite
|
|
6
|
-
|
|
7
|
-
Scaffold a minimal ArcGIS Maps SDK for JavaScript application.
|
|
8
|
-
|
|
9
|
-
## Project Structure
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
my-arcgis-app/
|
|
13
|
-
├── src/
|
|
14
|
-
│ ├── main.ts
|
|
15
|
-
│ └── style.css
|
|
16
|
-
├── index.html
|
|
17
|
-
├── package.json
|
|
18
|
-
├── tsconfig.json
|
|
19
|
-
├── vite.config.ts
|
|
20
|
-
├── .gitignore
|
|
21
|
-
└── README.md
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## package.json
|
|
25
|
-
|
|
26
|
-
```json
|
|
27
|
-
{
|
|
28
|
-
"name": "my-arcgis-app",
|
|
29
|
-
"private": true,
|
|
30
|
-
"version": "0.0.1",
|
|
31
|
-
"type": "module",
|
|
32
|
-
"scripts": {
|
|
33
|
-
"dev": "vite",
|
|
34
|
-
"build": "tsc && vite build",
|
|
35
|
-
"preview": "vite preview"
|
|
36
|
-
},
|
|
37
|
-
"devDependencies": {
|
|
38
|
-
"typescript": "~5.9.3",
|
|
39
|
-
"vite": "^7.2.7"
|
|
40
|
-
},
|
|
41
|
-
"dependencies": {
|
|
42
|
-
"@arcgis/map-components": "^4.34.9",
|
|
43
|
-
"@esri/calcite-components": "^3.3.3"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## index.html (2D Map)
|
|
49
|
-
|
|
50
|
-
```html
|
|
51
|
-
<!DOCTYPE html>
|
|
52
|
-
<html lang="en">
|
|
53
|
-
<head>
|
|
54
|
-
<meta charset="UTF-8" />
|
|
55
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
56
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
57
|
-
<title>ArcGIS Map App</title>
|
|
58
|
-
<link rel="stylesheet" href="/src/style.css" />
|
|
59
|
-
</head>
|
|
60
|
-
<body>
|
|
61
|
-
<calcite-shell content-behind>
|
|
62
|
-
<arcgis-map item-id="YOUR_WEBMAP_ID">
|
|
63
|
-
<arcgis-zoom position="top-left"></arcgis-zoom>
|
|
64
|
-
<arcgis-legend position="bottom-left"></arcgis-legend>
|
|
65
|
-
</arcgis-map>
|
|
66
|
-
</calcite-shell>
|
|
67
|
-
<script type="module" src="/src/main.ts"></script>
|
|
68
|
-
</body>
|
|
69
|
-
</html>
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## index.html (3D Scene)
|
|
73
|
-
|
|
74
|
-
```html
|
|
75
|
-
<!DOCTYPE html>
|
|
76
|
-
<html lang="en">
|
|
77
|
-
<head>
|
|
78
|
-
<meta charset="UTF-8" />
|
|
79
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
80
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
81
|
-
<title>ArcGIS Scene App</title>
|
|
82
|
-
<link rel="stylesheet" href="/src/style.css" />
|
|
83
|
-
</head>
|
|
84
|
-
<body>
|
|
85
|
-
<calcite-shell content-behind>
|
|
86
|
-
<arcgis-scene item-id="YOUR_WEBSCENE_ID">
|
|
87
|
-
<arcgis-zoom position="top-left"></arcgis-zoom>
|
|
88
|
-
<arcgis-navigation-toggle position="top-left"></arcgis-navigation-toggle>
|
|
89
|
-
<arcgis-compass position="top-left"></arcgis-compass>
|
|
90
|
-
</arcgis-scene>
|
|
91
|
-
</calcite-shell>
|
|
92
|
-
<script type="module" src="/src/main.ts"></script>
|
|
93
|
-
</body>
|
|
94
|
-
</html>
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
## src/main.ts (Map Components)
|
|
98
|
-
|
|
99
|
-
```typescript
|
|
100
|
-
import "@arcgis/map-components/dist/components/arcgis-map";
|
|
101
|
-
import "@arcgis/map-components/dist/components/arcgis-zoom";
|
|
102
|
-
import "@arcgis/map-components/dist/components/arcgis-legend";
|
|
103
|
-
// For 3D scenes, also import:
|
|
104
|
-
// import "@arcgis/map-components/dist/components/arcgis-scene";
|
|
105
|
-
// import "@arcgis/map-components/dist/components/arcgis-navigation-toggle";
|
|
106
|
-
// import "@arcgis/map-components/dist/components/arcgis-compass";
|
|
107
|
-
|
|
108
|
-
import "@esri/calcite-components/dist/components/calcite-shell";
|
|
109
|
-
import { setAssetPath as setCalciteAssetPath } from "@esri/calcite-components/dist/components";
|
|
110
|
-
|
|
111
|
-
// Set Calcite assets path
|
|
112
|
-
setCalciteAssetPath("https://js.arcgis.com/calcite-components/3.3.3/assets");
|
|
113
|
-
|
|
114
|
-
// Configure ArcGIS API key
|
|
115
|
-
import esriConfig from "@arcgis/core/config";
|
|
116
|
-
esriConfig.apiKey = "YOUR_API_KEY";
|
|
117
|
-
|
|
118
|
-
// Wait for map to be ready
|
|
119
|
-
const arcgisMap = document.querySelector("arcgis-map");
|
|
120
|
-
arcgisMap?.addEventListener("arcgisViewReadyChange", (event) => {
|
|
121
|
-
const { view } = (event as CustomEvent).detail;
|
|
122
|
-
console.log("Map view ready:", view);
|
|
123
|
-
});
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## src/main.ts (Core API - Programmatic)
|
|
127
|
-
|
|
128
|
-
```typescript
|
|
129
|
-
import "@esri/calcite-components/dist/components/calcite-shell";
|
|
130
|
-
import { setAssetPath as setCalciteAssetPath } from "@esri/calcite-components/dist/components";
|
|
131
|
-
|
|
132
|
-
import Map from "@arcgis/core/Map";
|
|
133
|
-
import MapView from "@arcgis/core/views/MapView";
|
|
134
|
-
|
|
135
|
-
// Set Calcite assets path
|
|
136
|
-
setCalciteAssetPath("https://js.arcgis.com/calcite-components/3.3.3/assets");
|
|
137
|
-
|
|
138
|
-
const map = new Map({ basemap: "topo-vector" });
|
|
139
|
-
|
|
140
|
-
// Create view
|
|
141
|
-
const view = new MapView({
|
|
142
|
-
container: "viewDiv",
|
|
143
|
-
map: map,
|
|
144
|
-
center: [-118.805, 34.027],
|
|
145
|
-
zoom: 13,
|
|
146
|
-
});
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
## src/style.css
|
|
150
|
-
|
|
151
|
-
```css
|
|
152
|
-
@import "@arcgis/core/assets/esri/themes/light/main.css";
|
|
153
|
-
|
|
154
|
-
html, body {
|
|
155
|
-
margin: 0;
|
|
156
|
-
padding: 0;
|
|
157
|
-
width: 100%;
|
|
158
|
-
height: 100%;
|
|
159
|
-
font-family: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
calcite-shell { width: 100%; height: 100%; }
|
|
163
|
-
arcgis-map, arcgis-scene, #viewDiv { width: 100%; height: 100%; }
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
## tsconfig.json
|
|
167
|
-
|
|
168
|
-
```json
|
|
169
|
-
{
|
|
170
|
-
"compilerOptions": {
|
|
171
|
-
"target": "ES2020",
|
|
172
|
-
"useDefineForClassFields": true,
|
|
173
|
-
"module": "ESNext",
|
|
174
|
-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
175
|
-
"skipLibCheck": true,
|
|
176
|
-
"moduleResolution": "bundler",
|
|
177
|
-
"allowImportingTsExtensions": true,
|
|
178
|
-
"isolatedModules": true,
|
|
179
|
-
"moduleDetection": "force",
|
|
180
|
-
"noEmit": true,
|
|
181
|
-
"strict": true,
|
|
182
|
-
"noUnusedLocals": true,
|
|
183
|
-
"noUnusedParameters": true,
|
|
184
|
-
"noFallthroughCasesInSwitch": true,
|
|
185
|
-
"noUncheckedSideEffectImports": true
|
|
186
|
-
},
|
|
187
|
-
"include": ["src"]
|
|
188
|
-
}
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
## vite.config.ts
|
|
192
|
-
|
|
193
|
-
```typescript
|
|
194
|
-
import { defineConfig } from "vite";
|
|
195
|
-
|
|
196
|
-
export default defineConfig({
|
|
197
|
-
build: { target: "esnext" }
|
|
198
|
-
});
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
## .gitignore
|
|
202
|
-
|
|
203
|
-
```
|
|
204
|
-
node_modules/
|
|
205
|
-
dist/
|
|
206
|
-
.env
|
|
207
|
-
.env.local
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
## README.md
|
|
211
|
-
|
|
212
|
-
```markdown
|
|
213
|
-
# My ArcGIS App
|
|
214
|
-
|
|
215
|
-
A web mapping application built with ArcGIS Maps SDK for JavaScript.
|
|
216
|
-
|
|
217
|
-
## Prerequisites
|
|
218
|
-
|
|
219
|
-
- Node.js 18+
|
|
220
|
-
- npm or pnpm
|
|
221
|
-
|
|
222
|
-
## Setup
|
|
223
|
-
|
|
224
|
-
1. Install dependencies:
|
|
225
|
-
npm install
|
|
226
|
-
|
|
227
|
-
2. Start development server:
|
|
228
|
-
npm run dev
|
|
229
|
-
|
|
230
|
-
3. Build for production:
|
|
231
|
-
npm run build
|
|
232
|
-
|
|
233
|
-
## Configuration
|
|
234
|
-
|
|
235
|
-
- API Key: Set your ArcGIS API key in src/main.ts
|
|
236
|
-
- Web Map/Scene ID: Update the item-id in index.html
|
|
237
|
-
|
|
238
|
-
## Technologies
|
|
239
|
-
|
|
240
|
-
- ArcGIS Maps SDK for JavaScript
|
|
241
|
-
- Calcite Design System
|
|
242
|
-
- TypeScript
|
|
243
|
-
- Vite
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
## Quick Start
|
|
247
|
-
|
|
248
|
-
```bash
|
|
249
|
-
npm install @arcgis/map-components @esri/calcite-components
|
|
250
|
-
npm install -D typescript vite
|
|
251
|
-
npm run dev
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
## Common Widgets
|
|
255
|
-
|
|
256
|
-
```typescript
|
|
257
|
-
// Import additional components as needed
|
|
258
|
-
import "@arcgis/map-components/dist/components/arcgis-search";
|
|
259
|
-
import "@arcgis/map-components/dist/components/arcgis-basemap-gallery";
|
|
260
|
-
import "@arcgis/map-components/dist/components/arcgis-layer-list";
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
```html
|
|
264
|
-
<arcgis-map item-id="YOUR_MAP_ID">
|
|
265
|
-
<arcgis-search position="top-right"></arcgis-search>
|
|
266
|
-
<arcgis-basemap-gallery position="top-right"></arcgis-basemap-gallery>
|
|
267
|
-
</arcgis-map>
|
|
268
|
-
```
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
applyTo: "**/*.{js,ts,jsx,tsx,html}"
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# ArcGIS Maps SDK - Time & Animation
|
|
6
|
-
|
|
7
|
-
Work with temporal data, time-aware layers, and animation controls.
|
|
8
|
-
|
|
9
|
-
## TimeExtent
|
|
10
|
-
|
|
11
|
-
```javascript
|
|
12
|
-
import TimeExtent from "@arcgis/core/TimeExtent.js";
|
|
13
|
-
|
|
14
|
-
const timeExtent = new TimeExtent({
|
|
15
|
-
start: new Date("2024-01-01"),
|
|
16
|
-
end: new Date("2024-12-31")
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
view.timeExtent = timeExtent;
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## TimeSlider Component
|
|
23
|
-
|
|
24
|
-
```html
|
|
25
|
-
<arcgis-map item-id="YOUR_WEBMAP_ID">
|
|
26
|
-
<arcgis-time-slider slot="bottom-left" mode="time-window" loop></arcgis-time-slider>
|
|
27
|
-
</arcgis-map>
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## TimeSlider Widget (Core API)
|
|
31
|
-
|
|
32
|
-
```javascript
|
|
33
|
-
import TimeSlider from "@arcgis/core/widgets/TimeSlider.js";
|
|
34
|
-
|
|
35
|
-
const timeSlider = new TimeSlider({
|
|
36
|
-
container: "timeSliderDiv",
|
|
37
|
-
view: view,
|
|
38
|
-
fullTimeExtent: {
|
|
39
|
-
start: new Date("2020-01-01"),
|
|
40
|
-
end: new Date("2024-12-31")
|
|
41
|
-
},
|
|
42
|
-
mode: "time-window", // instant, time-window, cumulative-from-start, cumulative-from-end
|
|
43
|
-
playRate: 1000,
|
|
44
|
-
loop: true,
|
|
45
|
-
stops: {
|
|
46
|
-
interval: { value: 1, unit: "months" }
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
// Playback controls
|
|
51
|
-
timeSlider.play();
|
|
52
|
-
timeSlider.stop();
|
|
53
|
-
|
|
54
|
-
// Watch for changes
|
|
55
|
-
timeSlider.watch("timeExtent", (timeExtent) => {
|
|
56
|
-
console.log("Time:", timeExtent.start, timeExtent.end);
|
|
57
|
-
});
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## Time-Aware Layers
|
|
61
|
-
|
|
62
|
-
```javascript
|
|
63
|
-
const layer = new FeatureLayer({
|
|
64
|
-
url: "https://services.arcgis.com/.../FeatureServer/0",
|
|
65
|
-
timeInfo: {
|
|
66
|
-
startField: "event_date",
|
|
67
|
-
endField: "end_date",
|
|
68
|
-
interval: { value: 1, unit: "days" }
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
await layer.load();
|
|
73
|
-
if (layer.timeInfo) {
|
|
74
|
-
timeSlider.fullTimeExtent = layer.timeInfo.fullTimeExtent;
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## Query with Time
|
|
79
|
-
|
|
80
|
-
```javascript
|
|
81
|
-
const query = layer.createQuery();
|
|
82
|
-
query.timeExtent = new TimeExtent({
|
|
83
|
-
start: new Date("2024-01-01"),
|
|
84
|
-
end: new Date("2024-12-31")
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
const results = await layer.queryFeatures(query);
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
## Custom Stops
|
|
91
|
-
|
|
92
|
-
```javascript
|
|
93
|
-
// Interval-based
|
|
94
|
-
stops: { interval: { value: 1, unit: "weeks" } }
|
|
95
|
-
|
|
96
|
-
// Specific dates
|
|
97
|
-
stops: { dates: [new Date("2024-01-01"), new Date("2024-04-01")] }
|
|
98
|
-
|
|
99
|
-
// Even count
|
|
100
|
-
stops: { count: 12 }
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## TimeInterval Units
|
|
104
|
-
|
|
105
|
-
`milliseconds`, `seconds`, `minutes`, `hours`, `days`, `weeks`, `months`, `years`
|
|
106
|
-
|
|
107
|
-
## Common Pitfalls
|
|
108
|
-
|
|
109
|
-
1. **Time zone issues** - Use UTC for consistency
|
|
110
|
-
2. **Layer must be loaded** - TimeInfo available after load()
|
|
111
|
-
3. **Null for all data** - Set `view.timeExtent = null` to show all
|
|
112
|
-
4. **Performance** - Large time ranges can be slow
|
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
applyTo: "**/*.{js,ts,jsx,tsx,html}"
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# ArcGIS Maps SDK - Visualization (Renderers & Symbols)
|
|
6
|
-
|
|
7
|
-
## Renderer Types
|
|
8
|
-
|
|
9
|
-
| Renderer | Use Case |
|
|
10
|
-
|----------|----------|
|
|
11
|
-
| SimpleRenderer | Same symbol for all features |
|
|
12
|
-
| UniqueValueRenderer | Different symbols by category |
|
|
13
|
-
| ClassBreaksRenderer | Different symbols by numeric ranges |
|
|
14
|
-
| HeatmapRenderer | Density visualization |
|
|
15
|
-
| DotDensityRenderer | Dot density maps |
|
|
16
|
-
|
|
17
|
-
## SimpleRenderer
|
|
18
|
-
|
|
19
|
-
```javascript
|
|
20
|
-
layer.renderer = {
|
|
21
|
-
type: "simple",
|
|
22
|
-
symbol: {
|
|
23
|
-
type: "simple-marker",
|
|
24
|
-
color: "blue",
|
|
25
|
-
size: 8,
|
|
26
|
-
outline: { color: "white", width: 1 }
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### With Visual Variables
|
|
32
|
-
```javascript
|
|
33
|
-
layer.renderer = {
|
|
34
|
-
type: "simple",
|
|
35
|
-
symbol: { type: "simple-marker", color: "#13EB0C" },
|
|
36
|
-
visualVariables: [{
|
|
37
|
-
type: "size",
|
|
38
|
-
field: "population",
|
|
39
|
-
stops: [
|
|
40
|
-
{ value: 1000, size: 4 },
|
|
41
|
-
{ value: 100000, size: 24 }
|
|
42
|
-
]
|
|
43
|
-
}]
|
|
44
|
-
};
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## UniqueValueRenderer
|
|
48
|
-
|
|
49
|
-
```javascript
|
|
50
|
-
layer.renderer = {
|
|
51
|
-
type: "unique-value",
|
|
52
|
-
field: "type",
|
|
53
|
-
defaultSymbol: { type: "simple-fill", color: "gray" },
|
|
54
|
-
uniqueValueInfos: [
|
|
55
|
-
{
|
|
56
|
-
value: "residential",
|
|
57
|
-
symbol: { type: "simple-fill", color: "#FFFF00" },
|
|
58
|
-
label: "Residential"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
value: "commercial",
|
|
62
|
-
symbol: { type: "simple-fill", color: "#FF0000" },
|
|
63
|
-
label: "Commercial"
|
|
64
|
-
}
|
|
65
|
-
]
|
|
66
|
-
};
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## ClassBreaksRenderer
|
|
70
|
-
|
|
71
|
-
```javascript
|
|
72
|
-
layer.renderer = {
|
|
73
|
-
type: "class-breaks",
|
|
74
|
-
field: "population",
|
|
75
|
-
classBreakInfos: [
|
|
76
|
-
{ minValue: 0, maxValue: 100, symbol: { type: "simple-fill", color: "#fffcd4" }, label: "< 100" },
|
|
77
|
-
{ minValue: 100, maxValue: 500, symbol: { type: "simple-fill", color: "#b1cdc2" }, label: "100 - 500" },
|
|
78
|
-
{ minValue: 500, maxValue: Infinity, symbol: { type: "simple-fill", color: "#0d2644" }, label: "> 500" }
|
|
79
|
-
]
|
|
80
|
-
};
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## HeatmapRenderer
|
|
84
|
-
|
|
85
|
-
```javascript
|
|
86
|
-
layer.renderer = {
|
|
87
|
-
type: "heatmap",
|
|
88
|
-
colorStops: [
|
|
89
|
-
{ color: "rgba(63, 40, 102, 0)", ratio: 0 },
|
|
90
|
-
{ color: "#472b77", ratio: 0.25 },
|
|
91
|
-
{ color: "#ffff00", ratio: 1 }
|
|
92
|
-
],
|
|
93
|
-
radius: 18,
|
|
94
|
-
maxDensity: 0.01
|
|
95
|
-
};
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## 2D Symbol Types
|
|
99
|
-
|
|
100
|
-
### SimpleMarkerSymbol (Points)
|
|
101
|
-
```javascript
|
|
102
|
-
const symbol = {
|
|
103
|
-
type: "simple-marker",
|
|
104
|
-
style: "circle", // circle, square, cross, x, diamond, triangle
|
|
105
|
-
color: [255, 0, 0],
|
|
106
|
-
size: 12,
|
|
107
|
-
outline: { color: [255, 255, 255], width: 2 }
|
|
108
|
-
};
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
### SimpleLineSymbol
|
|
112
|
-
```javascript
|
|
113
|
-
const symbol = {
|
|
114
|
-
type: "simple-line",
|
|
115
|
-
style: "solid", // solid, dash, dot, dash-dot
|
|
116
|
-
color: [0, 0, 255],
|
|
117
|
-
width: 2,
|
|
118
|
-
cap: "round",
|
|
119
|
-
join: "round"
|
|
120
|
-
};
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### SimpleFillSymbol
|
|
124
|
-
```javascript
|
|
125
|
-
const symbol = {
|
|
126
|
-
type: "simple-fill",
|
|
127
|
-
style: "solid",
|
|
128
|
-
color: [255, 255, 0, 0.5],
|
|
129
|
-
outline: { type: "simple-line", color: [0, 0, 0], width: 1 }
|
|
130
|
-
};
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### PictureMarkerSymbol
|
|
134
|
-
```javascript
|
|
135
|
-
const symbol = {
|
|
136
|
-
type: "picture-marker",
|
|
137
|
-
url: "https://example.com/icon.png",
|
|
138
|
-
width: 24,
|
|
139
|
-
height: 24
|
|
140
|
-
};
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### TextSymbol
|
|
144
|
-
```javascript
|
|
145
|
-
const symbol = {
|
|
146
|
-
type: "text",
|
|
147
|
-
text: "Label",
|
|
148
|
-
color: "white",
|
|
149
|
-
font: { family: "Arial", size: 12, weight: "bold" },
|
|
150
|
-
haloColor: "black",
|
|
151
|
-
haloSize: 1
|
|
152
|
-
};
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
## 3D Symbol Types
|
|
156
|
-
|
|
157
|
-
### PointSymbol3D
|
|
158
|
-
```javascript
|
|
159
|
-
const symbol = {
|
|
160
|
-
type: "point-3d",
|
|
161
|
-
symbolLayers: [{
|
|
162
|
-
type: "icon",
|
|
163
|
-
resource: { primitive: "circle" },
|
|
164
|
-
material: { color: "red" },
|
|
165
|
-
size: 12
|
|
166
|
-
}]
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
// Object marker
|
|
170
|
-
const symbol = {
|
|
171
|
-
type: "point-3d",
|
|
172
|
-
symbolLayers: [{
|
|
173
|
-
type: "object",
|
|
174
|
-
resource: { primitive: "cylinder" },
|
|
175
|
-
material: { color: "blue" },
|
|
176
|
-
height: 100,
|
|
177
|
-
width: 10
|
|
178
|
-
}]
|
|
179
|
-
};
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
### PolygonSymbol3D (Extrusion)
|
|
183
|
-
```javascript
|
|
184
|
-
const symbol = {
|
|
185
|
-
type: "polygon-3d",
|
|
186
|
-
symbolLayers: [{
|
|
187
|
-
type: "extrude",
|
|
188
|
-
material: { color: "blue" },
|
|
189
|
-
size: 100
|
|
190
|
-
}]
|
|
191
|
-
};
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
## Visual Variables
|
|
195
|
-
|
|
196
|
-
### Size Variable
|
|
197
|
-
```javascript
|
|
198
|
-
visualVariables: [{
|
|
199
|
-
type: "size",
|
|
200
|
-
field: "magnitude",
|
|
201
|
-
stops: [
|
|
202
|
-
{ value: 1, size: 4 },
|
|
203
|
-
{ value: 10, size: 40 }
|
|
204
|
-
]
|
|
205
|
-
}]
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
### Color Variable
|
|
209
|
-
```javascript
|
|
210
|
-
visualVariables: [{
|
|
211
|
-
type: "color",
|
|
212
|
-
field: "temperature",
|
|
213
|
-
stops: [
|
|
214
|
-
{ value: 0, color: "blue" },
|
|
215
|
-
{ value: 100, color: "red" }
|
|
216
|
-
]
|
|
217
|
-
}]
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
### Opacity Variable
|
|
221
|
-
```javascript
|
|
222
|
-
visualVariables: [{
|
|
223
|
-
type: "opacity",
|
|
224
|
-
field: "confidence",
|
|
225
|
-
stops: [
|
|
226
|
-
{ value: 0, opacity: 0.1 },
|
|
227
|
-
{ value: 100, opacity: 1 }
|
|
228
|
-
]
|
|
229
|
-
}]
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
### Rotation Variable
|
|
233
|
-
```javascript
|
|
234
|
-
visualVariables: [{
|
|
235
|
-
type: "rotation",
|
|
236
|
-
field: "heading",
|
|
237
|
-
rotationType: "geographic"
|
|
238
|
-
}]
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
## Labeling
|
|
242
|
-
|
|
243
|
-
```javascript
|
|
244
|
-
layer.labelingInfo = [{
|
|
245
|
-
symbol: {
|
|
246
|
-
type: "text",
|
|
247
|
-
color: "white",
|
|
248
|
-
font: { family: "Noto Sans", size: 10, weight: "bold" },
|
|
249
|
-
haloColor: "#472b77",
|
|
250
|
-
haloSize: 1
|
|
251
|
-
},
|
|
252
|
-
labelPlacement: "above-center",
|
|
253
|
-
labelExpressionInfo: {
|
|
254
|
-
expression: "$feature.name"
|
|
255
|
-
},
|
|
256
|
-
where: "population > 10000",
|
|
257
|
-
minScale: 500000
|
|
258
|
-
}];
|
|
259
|
-
|
|
260
|
-
layer.labelsVisible = true;
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
### Label Placements
|
|
264
|
-
- Points: `above-center`, `below-center`, `center-center`
|
|
265
|
-
- Lines: `above-along`, `below-along`, `center-along`
|
|
266
|
-
- Polygons: `always-horizontal`
|
|
267
|
-
|
|
268
|
-
## Effects and Blend Modes
|
|
269
|
-
|
|
270
|
-
```javascript
|
|
271
|
-
// Layer effects
|
|
272
|
-
layer.effect = "drop-shadow(2px 2px 3px gray)";
|
|
273
|
-
layer.effect = "blur(2px)";
|
|
274
|
-
layer.effect = "grayscale(100%)";
|
|
275
|
-
layer.effect = "brightness(150%) contrast(120%)";
|
|
276
|
-
|
|
277
|
-
// Blend modes
|
|
278
|
-
layer.blendMode = "multiply";
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
## Feature Effects
|
|
282
|
-
|
|
283
|
-
```javascript
|
|
284
|
-
import FeatureEffect from "@arcgis/core/layers/support/FeatureEffect.js";
|
|
285
|
-
|
|
286
|
-
layerView.featureEffect = new FeatureEffect({
|
|
287
|
-
filter: { where: "population > 100000" },
|
|
288
|
-
includedEffect: "bloom(1, 0.5px, 0.2)",
|
|
289
|
-
excludedEffect: "grayscale(100%) opacity(30%)"
|
|
290
|
-
});
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
## Smart Mapping (Auto-generated Renderers)
|
|
294
|
-
|
|
295
|
-
```javascript
|
|
296
|
-
import colorRendererCreator from "@arcgis/core/smartMapping/renderers/color.js";
|
|
297
|
-
|
|
298
|
-
const response = await colorRendererCreator.createContinuousRenderer({
|
|
299
|
-
layer: layer,
|
|
300
|
-
field: "population",
|
|
301
|
-
view: view,
|
|
302
|
-
theme: "high-to-low"
|
|
303
|
-
});
|
|
304
|
-
layer.renderer = response.renderer;
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
## TypeScript: Use `as const`
|
|
308
|
-
|
|
309
|
-
```typescript
|
|
310
|
-
layer.renderer = {
|
|
311
|
-
type: "simple",
|
|
312
|
-
symbol: { type: "simple-marker", color: "red", size: 8 }
|
|
313
|
-
} as const;
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
## Common Pitfalls
|
|
317
|
-
|
|
318
|
-
1. **Missing type property** - Always include `type` for autocasting
|
|
319
|
-
2. **Color formats** - Use hex, named, RGB array, or RGBA array
|
|
320
|
-
3. **Visual variables require numeric fields** - Field must contain numbers
|
|
321
|
-
4. **Label expressions are Arcade** - Use Arcade syntax, not JavaScript
|