@saschabrunnerch/arcgis-maps-sdk-js-ai-context 0.0.1 → 0.0.2
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 +4 -2
- package/contexts/4.34/claude/arcgis-starter-app/SKILL.md +273 -0
- package/contexts/4.34/claude/arcgis-starter-app-extended/SKILL.md +649 -0
- package/contexts/4.34/copilot/arcgis-starter-app-extended.instructions.md +643 -0
- package/contexts/4.34/copilot/arcgis-starter-app.instructions.md +268 -0
- package/lib/installer.js +379 -379
- package/package.json +1 -1
|
@@ -0,0 +1,268 @@
|
|
|
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
|
+
```
|