-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
559 lines (508 loc) · 19.3 KB
/
index.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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<title>Esri Dev Summit 2022 - ArcGIS JS API for JavaScript: Web editing in 3D</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Fira+Code&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="./reveal.js/dist/reset.css" />
<link rel="stylesheet" href="./reveal.js/dist/reveal.css" />
<link rel="stylesheet" href="./reveal.js/dist/theme/black.css" />
<link rel="stylesheet" href="./resources/highlighting-theme.css" />
<link rel="stylesheet" href="./resources/main.css" />
</head>
<body>
<div class="reveal">
<div class="slides">
<section data-background="img/2022/dev-summit/bg-1.png" data-background-size="cover">
<h1 style="text-align: left; font-size: 60px">
ArcGIS JS API for JavaScript: <br />
Web editing in 3D
</h1>
<p style="text-align: left; font-size: 30px; color: var(--r-section-subhead-color)">
Hugo Campos & Jesse van den Kieboom
</p>
<p style="text-align: left; font-size: 30px">
Slides:
<a href="https://esridevsummit.github.io/DS2022-Web-Editing-in-3D/"><code>https://esridevsummit.github.io/DS2022-Web-Editing-in-3D/</code></a>
</p>
</section>
<section data-background="img/2022/dev-summit/bg-7.png">
<h2 id="agenda">Agenda</h2>
<ul style="font-size: 2rem">
<li>From editing in 2D to editing in 3D</li>
<li>SketchViewModel basics in 3D</li>
<li>FeatureLayer and the Editor widget</li>
<li>SceneLayer editing</li>
<li>Customized Editing</li>
</ul>
</section>
<section class="align-left" data-background="img/2022/dev-summit/bg-2.png">
<h2>From editing in 2D to editing in 3D</h2>
<div class="two-columns">
<div class="left-column" style="width: 50%">
<ul style="font-size: 2rem">
<li>
Using the <code>Editor</code> widget in a <code>SceneView</code> works out-of-the
box.
</li>
<li>
<code>SketchViewModel</code>, <code>FeatureForm</code> and
<code>Editor</code> work similarly in 2D and 3D.
</li>
<li>No need to prepare data specifically for 3D.</li>
</ul>
<pre data-fragment-id="use-scene-view" class="code-snippet fragment">
<button class="play"></button>
<code class="lang-ts" data-trim>
// const view = new MapView({ /* ... */ });
const view = new SceneView({ /* ... */ });
const editor = new Editor({ view /* ... */})
</code>
</pre>
</div>
<div class="right-column">
<iframe data-src="./src/samples/editing-2d-to-3d/index.html"></iframe>
</div>
</div>
</section>
<!--
Tree
-->
<section
data-slideId="tree"
class="align-left"
data-background="img/2022/dev-summit/bg-2.png"
>
<h2 class="header">Placing a tree on the ground</h2>
<div class="two-columns">
<div class="left-column">
<div data-fragment-id="place-point" class="code-snippet">
<button class="play"></button>
<pre>
<code class="lang-ts" data-trim>
const tree = new Graphic({
geometry: new Point({
x: 1099766.76,
y: 5865813.01
// Note: no Z value!
})
});
const trees = new GraphicsLayer({
elevationInfo: { mode: "on-the-ground" }
});
trees.add(tree);
</code>
</pre>
</div>
<div data-fragment-id="set-tree-symbol" class="code-snippet fragment">
<button class="play"></button>
<pre>
<code class="lang-ts" data-trim>
const webStyle = new WebStyleSymbol({
/* ... */
});
tree.symbol = await webStyle.fetchSymbol();
</code>
</pre>
</div>
</div>
<div class="right-column">
<iframe data-src="./src/samples/tree/index.html"></iframe>
</div>
</div>
</section>
<section class="align-left" data-background="img/2022/dev-summit/bg-2.png">
<h2 class="header">Web Style Symbols</h2>
<iframe
class="r-stretch"
data-src="https://developers.arcgis.com/javascript/latest/visualization/symbols-color-ramps/esri-web-style-symbols-3d/#schematic-vegetation"
></iframe>
</section>
<!--
Tree (Editable)
-->
<section
data-slideId="tree-editable"
class="align-left"
data-background="img/2022/dev-summit/bg-2.png"
>
<h2 class="header">Moving a tree on the ground</h2>
<div class="two-columns">
<div class="left-column">
<div data-fragment-id="update-tree" class="code-snippet">
<button class="play"></button>
<pre>
<code class="lang-ts" data-trim>
const sketchVM = new SketchViewModel({
view,
layer: trees
});
sketchVM.update(tree);
</code>
</pre>
</div>
</div>
<div class="right-column">
<iframe data-src="./src/samples/tree/index.html"></iframe>
</div>
</div>
</section>
<!--
Antenna
-->
<section
data-slideId="antenna"
class="align-left"
data-background="img/2022/dev-summit/bg-2.png"
>
<h2 class="header">Placing an antenna on the roof</h2>
<div class="two-columns">
<div class="left-column">
<div data-fragment-id="create-point" class="code-snippet">
<button class="play"></button>
<pre>
<code class="lang-ts" data-trim>
sketchVM.layer = antennas;
sketchVM.pointSymbol = antennaSymbol;
sketchVM.on("create", (event) => {
if (event.state === "complete") {
sketchVM.update(event.graphic);
}
});
sketchVM.create("point");
</code>
</pre>
</div>
<div
data-fragment-id="set-relative-to-scene"
class="code-snippet play-container fragment"
>
<button class="play"></button>
<pre>
<code class="lang-ts" data-trim>
antennas.elevationInfo = {
mode: "relative-to-scene"
};
</code>
</pre>
</div>
</div>
<div class="right-column">
<iframe data-src="./src/samples/antenna/index.html"></iframe>
</div>
</div>
</section>
<!--
Airplane
-->
<section
data-slideId="airplane"
class="align-left"
data-background="img/2022/dev-summit/bg-2.png"
>
<h2 class="header">Placing an airplane in the air</h2>
<div class="two-columns">
<div class="left-column">
<div data-fragment-id="create" class="code-snippet">
<button class="play"></button>
<pre>
<code class="lang-ts" data-trim>
const geometry = new Point({
x: 1099766.76,
y: 5865813.01,
z: 20 // We now have elevation!!!
});
const airplane = new Graphic({ geometry, symbol });
const airplanes = new GraphicsLayer({
elevationInfo: { mode: "relative-to-ground" },
});
airplanes.add(airplane);
</code>
</pre>
</div>
<div data-fragment-id="set-absolute-height" class="code-snippet fragment">
<button class="play"></button>
<pre>
<code class="lang-ts" data-trim>
airplanes.elevationInfo = {
mode: "absolute-height"
};
airplane.geometry.z = 1708; // Runway elevation
</code>
</pre>
</div>
</div>
<div class="right-column">
<iframe data-src="./src/samples/airplane/index.html"></iframe>
</div>
</div>
</section>
<!--
Airport building
-->
<section
data-slideId="terminal"
class="align-left"
data-background="img/2022/dev-summit/bg-2.png"
>
<h2 class="header">Sketching a new airport building</h2>
<div class="two-columns">
<div class="left-column">
<div data-fragment-id="create" class="code-snippet">
<button class="play"></button>
<pre>
<code class="lang-ts" data-trim>
const terminals = new GraphicsLayer();
sketchVM.layer = terminals;
sketchVM.polygonSymbol = new PolygonSymbol3D({
symbolLayers: [new ExtrudeSymbol3DLayer({
size: 10
})]
});
sketchVM.create("polygon");
</code>
</pre>
</div>
<div data-fragment-id="enable-snapping" class="code-snippet fragment">
<button class="play"></button>
<pre>
<code class="lang-ts" data-trim>
Object.assign(sketchVM.snappingOptions, {
enabled: true,
featureSources: [{ layer: terminals }]
});
</code>
</pre>
</div>
<div data-fragment-id="enable-edge-offset" class="code-snippet fragment">
<button class="play"></button>
<pre>
<code class="lang-ts" data-trim>
sketchVM
.defaultUpdateOptions
.reshapeOptions
.edgeOperation = "offset";
</code>
</pre>
</div>
</div>
<div class="right-column">
<iframe data-src="./src/samples/airport-terminal/index.html"></iframe>
</div>
</div>
</section>
<!--
FeatureLayer
-->
<section
data-slideId="feature-layer"
class="align-left"
data-background="img/2022/dev-summit/bg-2.png"
>
<h2 class="header">FeatureLayer and the Editor widget</h2>
<div class="two-columns">
<div class="left-column r-stack no-margin">
<div
data-fragment-id="editor-widget"
data-fragment-index="0"
class="code-snippet fragment fade-out"
>
<button class="play"></button>
<pre>
<code class="lang-ts" data-trim>
const aircraftLayer = new FeatureLayer({
title: "Aircraft",
url: "...",
elevationInfo: { mode: "absolute-height" },
/* ... */
});
view.map.add(aircraftLayer);
const editor = new Editor({ view });
view.ui.add(editor, "top-right");
</code>
</pre>
</div>
<div
data-fragment-id="visual-variables-all"
data-fragment-index="0"
class="code-snippet fragment fade-in-then-out"
>
<pre>
<code class="lang-ts" data-trim>
const aircraftLayer = new FeatureLayer({
/* ... */
renderer: new UniqueValueRenderer({
/* ... */
visualVariables: [
new SizeVariable({
axis: "height",
field: "SIZE",
valueUnit: "meters",
}),
new RotationVariable({
field: "ROTATION",
rotationType: "geographic",
}),
],
})
});
</code>
</pre>
</div>
<div
data-fragment-id="visual-variables-rotation"
class="code-snippet fragment fade-in-then-out"
>
<button class="play"></button>
<pre>
<code class="lang-ts" data-trim>
const newRenderer = renderer.clone();
newRenderer.visualVariables = [
new RotationVariable({
field: "ROTATION",
rotationType: "geographic",
}),
];
aircraftLayer.renderer = newRenderer;
</code>
</pre>
</div>
<div data-fragment-id="layer-infos" class="code-snippet fragment fade-in-then-out">
<button class="play"></button>
<pre>
<code class="lang-ts" data-trim>
editor.layerInfos = [{
layer: aircraftLayer,
formTemplate: new FormTemplate({
elements: [
new FieldElement({
fieldName: "ROTATION",
label: "Rotation"
})
],
})
}];
</code>
</pre>
</div>
</div>
<div class="right-column">
<iframe data-src="./src/samples/feature-layer/index.html"></iframe>
</div>
</div>
</section>
<!--
SceneLayer
-->
<section
data-slideId="scene-layer"
class="align-left"
data-background="img/2022/dev-summit/bg-2.png"
>
<h2 class="header">SceneLayer editing</h2>
<div class="two-columns">
<div class="left-column v-stack no-margin" style="width: 50%">
<div data-fragment-id="add-widget" class="code-snippet">
<button class="play"></button>
<pre>
<code class="lang-ts" data-trim>
const editor = new Editor({ view });
view.ui.add(editor, "top-right");
</code>
</pre>
</div>
<div
data-fragment-id="add-widget"
class="code-snippet"
style="place-content: center; display: grid; flex-grow: 1"
>
<img src="./src/images/data-connected-scene-layer.png" style="filter: invert(1)" />
</div>
</div>
<div class="right-column">
<iframe data-src="./src/samples/scene-layer/index.html"></iframe>
</div>
</div>
</section>
<section data-background="img/2022/dev-summit/bg-2.png">
<h1>Customized editing</h1>
<iframe class="r-stretch" data-src="./src/samples/customized-editing/index.html"></iframe>
</section>
<section class="align-left" data-background="img/2022/dev-summit/bg-3.png">
<h2>Documentation & Resources</h2>
<ul class="align-left">
<li>
<a
href="https://developers.arcgis.com/javascript/latest/sample-code/scene-elevationinfo/"
>
Sample: Elevation options
</a>
</li>
<li>
<a href="https://developers.arcgis.com/javascript/latest/sample-code/sketch-3d/">
Sample: Sketch in 3D
</a>
</li>
<li>
<a
href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-editor-3d/"
>Sample: Edit features in 3D with the Editor widget</a
>
</li>
<li>
<a
href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-editor-3d-scenelayer/"
>Sample: SceneLayer attribute editing</a
>
</li>
<li>
<a
href="https://developers.arcgis.com/javascript/latest/sample-code/layers-integratedmeshlayer-modification/"
>
Sample: IntegratedMeshLayer modifications
</a>
</li>
<br />
<li>
<a
href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html"
>
API Docs: SketchViewModel
</a>
</li>
<li>
<a
href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-interactive-snapping-SnappingOptions.html"
>
API Docs: SnappingOptions
</a>
</li>
<li>
<a
href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html#modifications"
>
API Docs: IntegratedMeshLayer modifications
</a>
</li>
</ul>
</section>
<!-- FEEDBACK SLIDE: -->
<section data-background="img/2022/dev-summit/bg-7.png">
<h3>Please share your feedback in the app</h3>
<img src="./resources/feedback.png" />
</section>
<!-- ESRI LOGO SLIDE: -->
<section data-background="img/2022/dev-summit/bg-8.png">
<!-- <img src="img/esri-science-logo-white.png" /> -->
</section>
</div>
</div>
<script src="./src/main.js" type="module"></script>
</body>
</html>