@arcgis/map-components 5.2.0-next.11 → 5.2.0-next.12
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/dist/cdn/IJZYN6XT.js +2 -0
- package/dist/cdn/KI4JUPA7.js +2 -0
- package/dist/cdn/OJIPBNXS.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-features/customElement.d.ts +15 -0
- package/dist/components/arcgis-features/customElement.js +33 -33
- package/dist/components/arcgis-features-next/customElement.d.ts +14 -0
- package/dist/components/arcgis-features-next/customElement.js +1 -1
- package/dist/components/arcgis-layer-list-next/customElement.d.ts +2 -15
- package/dist/components/arcgis-layer-list-next/customElement.js +61 -53
- package/dist/components/arcgis-layer-list-next/layer-list-item/customElement.js +71 -72
- package/dist/components/arcgis-layer-list-next/types.d.ts +18 -0
- package/dist/components/arcgis-map/customElement.d.ts +126 -105
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +2 -2
- package/dist/types/lumina.d.ts +2 -2
- package/dist/types/preact.d.ts +2 -2
- package/dist/types/react.d.ts +2 -2
- package/dist/types/stencil.d.ts +2 -2
- package/package.json +4 -4
- package/dist/cdn/AGOMMJPB.js +0 -2
- package/dist/cdn/CTHUSEAE.js +0 -2
- package/dist/cdn/EVMYQ43N.js +0 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type CatalogLayer from "@arcgis/core/layers/CatalogLayer.js";
|
|
2
|
+
import type KnowledgeGraphLayer from "@arcgis/core/layers/KnowledgeGraphLayer.js";
|
|
3
|
+
import type MapImageLayer from "@arcgis/core/layers/MapImageLayer.js";
|
|
4
|
+
import type TileLayer from "@arcgis/core/layers/TileLayer.js";
|
|
5
|
+
import type { CatalogLayerListProperties } from "@arcgis/core/widgets/CatalogLayerList.js";
|
|
6
|
+
import type { TableListProperties } from "@arcgis/core/widgets/TableList.js";
|
|
7
|
+
|
|
8
|
+
/** Catalog layer list configuration passed through Layer List (next). */
|
|
9
|
+
export type CatalogLayerListParams = CatalogLayerListProperties;
|
|
10
|
+
|
|
11
|
+
/** Table list configuration passed through Layer List (next). */
|
|
12
|
+
export type TableListParams = TableListProperties;
|
|
13
|
+
|
|
14
|
+
/** Layer types that can open a nested flow list from Layer List (next). */
|
|
15
|
+
export type FlowLayer = CatalogLayer | SubtablesLayer;
|
|
16
|
+
|
|
17
|
+
/** Layer types that expose tables via the Table List flow. */
|
|
18
|
+
export type SubtablesLayer = KnowledgeGraphLayer | MapImageLayer | TileLayer;
|
|
@@ -141,11 +141,15 @@ export abstract class ArcgisMap extends LitElement {
|
|
|
141
141
|
*
|
|
142
142
|
* @since 4.34
|
|
143
143
|
* @example
|
|
144
|
+
* ```js
|
|
144
145
|
* // Adds an analysis to the View
|
|
145
146
|
* view.analyses.add(elevationProfileAnalysis);
|
|
147
|
+
* ```
|
|
146
148
|
* @example
|
|
149
|
+
* ```js
|
|
147
150
|
* // Removes an analysis from the View
|
|
148
151
|
* view.analyses.remove(elevationProfileAnalysis);
|
|
152
|
+
* ```
|
|
149
153
|
*/
|
|
150
154
|
accessor analyses: Collection<Analysis>;
|
|
151
155
|
/**
|
|
@@ -198,13 +202,12 @@ export abstract class ArcgisMap extends LitElement {
|
|
|
198
202
|
* The background color of the Map component.
|
|
199
203
|
*
|
|
200
204
|
* @example
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
* color: "magenta" // autocasts as new Color()
|
|
206
|
-
* }
|
|
205
|
+
* ```js
|
|
206
|
+
* const viewElement = document.querySelector("arcgis-map");
|
|
207
|
+
* viewElement.background = new ColorBackground ({
|
|
208
|
+
* color: "magenta" // autocasts as new Color()
|
|
207
209
|
* });
|
|
210
|
+
* ```
|
|
208
211
|
*/
|
|
209
212
|
accessor background: ColorBackground | null | undefined;
|
|
210
213
|
/**
|
|
@@ -295,11 +298,11 @@ export abstract class ArcgisMap extends LitElement {
|
|
|
295
298
|
* x: 12804.24,
|
|
296
299
|
* y: -1894032.09,
|
|
297
300
|
* spatialReference: {
|
|
298
|
-
* wkid:
|
|
301
|
+
* wkid: viewElement.spatialReference // wkid 2027
|
|
299
302
|
* }
|
|
300
303
|
* });
|
|
301
304
|
* const viewElement = document.querySelector("arcgis-map");
|
|
302
|
-
*
|
|
305
|
+
* viewElement.center = centerPoint;
|
|
303
306
|
* ```
|
|
304
307
|
* @example
|
|
305
308
|
* ```js
|
|
@@ -329,7 +332,9 @@ export abstract class ArcgisMap extends LitElement {
|
|
|
329
332
|
* @see [TileInfo#create()](https://developers.arcgis.com/javascript/latest/references/core/layers/support/TileInfo/#create)
|
|
330
333
|
* @see [Zoom and LODs](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#mapview-lods)
|
|
331
334
|
* @example
|
|
332
|
-
*
|
|
335
|
+
* ```js
|
|
336
|
+
* const viewElement = document.querySelector("arcgis-map");
|
|
337
|
+
* viewElement.constraints = new MapViewConstraints({
|
|
333
338
|
* geometry: { // Constrain lateral movement to Lower Manhattan
|
|
334
339
|
* type: "extent",
|
|
335
340
|
* xmin: -74.020,
|
|
@@ -341,7 +346,9 @@ export abstract class ArcgisMap extends LitElement {
|
|
|
341
346
|
* maxScale: 0, // User can overzoom tiles
|
|
342
347
|
* rotationEnabled: false // Disables map rotation
|
|
343
348
|
* });
|
|
349
|
+
* ```
|
|
344
350
|
* @example
|
|
351
|
+
* ```js
|
|
345
352
|
* // This snippet shows how to set the Map scale 1:1 while generating additional LODs for the constraints.
|
|
346
353
|
* const spatialReference = new SpatialReference({
|
|
347
354
|
* wkid: 2154
|
|
@@ -364,11 +371,12 @@ export abstract class ArcgisMap extends LitElement {
|
|
|
364
371
|
* lods
|
|
365
372
|
* });
|
|
366
373
|
*
|
|
367
|
-
* const
|
|
368
|
-
*
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
*
|
|
374
|
+
* const viewElement = document.querySelector("arcgis-map");
|
|
375
|
+
* viewElement.spatialReference = spatialReference;
|
|
376
|
+
* viewElement.center = center;
|
|
377
|
+
* viewElement.scale = 1;
|
|
378
|
+
* viewElement.constraints = constraints;
|
|
379
|
+
* ```
|
|
372
380
|
*/
|
|
373
381
|
accessor constraints: MapViewConstraints;
|
|
374
382
|
/**
|
|
@@ -401,13 +409,15 @@ export abstract class ArcgisMap extends LitElement {
|
|
|
401
409
|
* @since 4.12
|
|
402
410
|
* @see [tryFatalErrorRecovery()](https://developers.arcgis.com/javascript/latest/references/core/views/View/#tryFatalErrorRecovery)
|
|
403
411
|
* @example
|
|
412
|
+
* ```js
|
|
404
413
|
* reactiveUtils.when(
|
|
405
|
-
* () =>
|
|
414
|
+
* () => viewElement.fatalError,
|
|
406
415
|
* () => {
|
|
407
416
|
* console.error("Fatal Error! View has lost its WebGL context. Attempting to recover...");
|
|
408
|
-
*
|
|
417
|
+
* viewElement.tryFatalErrorRecovery();
|
|
409
418
|
* }
|
|
410
419
|
* );
|
|
420
|
+
* ```
|
|
411
421
|
*/
|
|
412
422
|
accessor fatalError: Error<any> | null | undefined;
|
|
413
423
|
/**
|
|
@@ -418,17 +428,17 @@ export abstract class ArcgisMap extends LitElement {
|
|
|
418
428
|
/** Gamepad input specific configuration settings. */
|
|
419
429
|
get gamepad(): GamepadSettings;
|
|
420
430
|
/**
|
|
421
|
-
* Allows for adding graphics directly to the default graphics in the
|
|
431
|
+
* Allows for adding graphics directly to the default graphics in the map component.
|
|
422
432
|
*
|
|
423
433
|
* @example
|
|
424
434
|
* ```js
|
|
425
|
-
* // Adds a graphic to the
|
|
426
|
-
* graphics.add(pointGraphic);
|
|
435
|
+
* // Adds a graphic to the map component.
|
|
436
|
+
* viewElement.graphics.add(pointGraphic);
|
|
427
437
|
* ```
|
|
428
438
|
* @example
|
|
429
439
|
* ```js
|
|
430
|
-
* // Removes a graphic from the
|
|
431
|
-
* graphics.remove(pointGraphic);
|
|
440
|
+
* // Removes a graphic from the map component.
|
|
441
|
+
* viewElement.graphics.remove(pointGraphic);
|
|
432
442
|
* ```
|
|
433
443
|
* @see [Graphic](https://developers.arcgis.com/javascript/latest/references/core/Graphic/)
|
|
434
444
|
* @see [GraphicsLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GraphicsLayer/)
|
|
@@ -441,12 +451,7 @@ export abstract class ArcgisMap extends LitElement {
|
|
|
441
451
|
* @see [ElevationLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ElevationLayer/)
|
|
442
452
|
* @see [Ground](https://developers.arcgis.com/javascript/latest/references/core/Ground/)
|
|
443
453
|
* @example
|
|
444
|
-
*
|
|
445
|
-
* const map = new Map({
|
|
446
|
-
* basemap: "topo-vector",
|
|
447
|
-
* ground: "world-elevation"
|
|
448
|
-
* });
|
|
449
|
-
* @example
|
|
454
|
+
* ```js
|
|
450
455
|
* // Create a map with the world elevation layer overlaid by a custom elevation layer
|
|
451
456
|
* const worldElevation = new ElevationLayer({
|
|
452
457
|
* url: "//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"
|
|
@@ -460,6 +465,9 @@ export abstract class ArcgisMap extends LitElement {
|
|
|
460
465
|
* layers: [ worldElevation, customElevation ]
|
|
461
466
|
* })
|
|
462
467
|
* });
|
|
468
|
+
*
|
|
469
|
+
* viewElement.map = map;
|
|
470
|
+
* ```
|
|
463
471
|
*/
|
|
464
472
|
get ground(): Ground;
|
|
465
473
|
set ground(value: Ground | string);
|
|
@@ -504,40 +512,47 @@ export abstract class ArcgisMap extends LitElement {
|
|
|
504
512
|
* @see [Sample: Highlight point features](https://developers.arcgis.com/javascript/latest/sample-code/highlight-point-features/)
|
|
505
513
|
* @since 4.32
|
|
506
514
|
* @example
|
|
515
|
+
* ```js
|
|
507
516
|
* // Use the default highlights collection to apply a highlight to features when you hover over them
|
|
508
|
-
*
|
|
509
517
|
* // A handler can be used to remove any previous highlight when applying a new one
|
|
510
518
|
* let hoverHighlight;
|
|
511
519
|
*
|
|
512
|
-
*
|
|
513
|
-
*
|
|
514
|
-
*
|
|
515
|
-
*
|
|
516
|
-
*
|
|
517
|
-
*
|
|
518
|
-
* // Remove any previous highlight, if it exists
|
|
519
|
-
* hoverHighlight?.remove();
|
|
520
|
-
* // Highlight the hit features with the temporary highlight options, which are pre-configured for this use case
|
|
521
|
-
* hoverHighlight = layerView.highlight(graphic, { name: "temporary"});
|
|
522
|
-
* });
|
|
520
|
+
* viewElement.addEventListener("arcgisViewPointerMove", async (event) => {
|
|
521
|
+
* try {
|
|
522
|
+
* await updateHoverHighlight(event);
|
|
523
|
+
* } catch (error) {
|
|
524
|
+
* if (error.name !== "AbortError") {
|
|
525
|
+
* console.error(error);
|
|
523
526
|
* }
|
|
524
|
-
* }
|
|
527
|
+
* }
|
|
525
528
|
* });
|
|
526
|
-
* @example
|
|
527
|
-
* // Override the default highlights collection
|
|
528
529
|
*
|
|
529
|
-
* const
|
|
530
|
-
*
|
|
531
|
-
*
|
|
530
|
+
* const updateHoverHighlight = promiseUtils.debounce(async (event) => {
|
|
531
|
+
* // Search for the first feature in the featureLayer at the hovered location
|
|
532
|
+
* const response = await viewElement.hitTest(event.detail, { include: featureLayer });
|
|
533
|
+
* const result = response.results[0];
|
|
532
534
|
*
|
|
533
|
-
* //
|
|
534
|
-
*
|
|
535
|
-
*
|
|
536
|
-
*
|
|
537
|
-
*
|
|
538
|
-
*
|
|
535
|
+
* // Remove any previous highlight, if it exists
|
|
536
|
+
* hoverHighlight?.remove();
|
|
537
|
+
*
|
|
538
|
+
* if (result?.type === "graphic") {
|
|
539
|
+
* // Highlight the hit feature with the temporary highlight options
|
|
540
|
+
* hoverHighlight = layerView.highlight(result.graphic, { name: "temporary" });
|
|
541
|
+
* }
|
|
539
542
|
* });
|
|
543
|
+
* ```
|
|
544
|
+
* @example
|
|
545
|
+
* ```js
|
|
546
|
+
* // Override the default highlights collection
|
|
547
|
+
* const viewElement = document.querySelector("arcgis-map");
|
|
548
|
+
* viewElement.highlights = new Collection([
|
|
549
|
+
* { name: "default", color: "orange" },
|
|
550
|
+
* { name: "temporary", color: "magenta" },
|
|
551
|
+
* { name: "table", color: "cyan", fillOpacity: 0.5, haloOpacity: 0}
|
|
552
|
+
* ]);
|
|
553
|
+
* ```
|
|
540
554
|
* @example
|
|
555
|
+
* ```js
|
|
541
556
|
* // Add highlight options to the collection after initialization
|
|
542
557
|
*
|
|
543
558
|
* const selectionHighlightOptions = {
|
|
@@ -548,7 +563,8 @@ export abstract class ArcgisMap extends LitElement {
|
|
|
548
563
|
* };
|
|
549
564
|
*
|
|
550
565
|
* // Add the options to the highlights collection at the first position
|
|
551
|
-
*
|
|
566
|
+
* viewElement.highlights.add(selectionGroup, 0);
|
|
567
|
+
* ```
|
|
552
568
|
*/
|
|
553
569
|
accessor highlights: Collection<HighlightOptions>;
|
|
554
570
|
/**
|
|
@@ -602,26 +618,21 @@ export abstract class ArcgisMap extends LitElement {
|
|
|
602
618
|
*
|
|
603
619
|
* @since 4.9
|
|
604
620
|
* @example
|
|
621
|
+
* ```js
|
|
605
622
|
* // Disable the gamepad usage, single touch panning, panning momentum and mouse wheel zooming.
|
|
606
|
-
* const
|
|
607
|
-
*
|
|
608
|
-
*
|
|
609
|
-
*
|
|
610
|
-
* }
|
|
611
|
-
*
|
|
612
|
-
*
|
|
613
|
-
*
|
|
614
|
-
*
|
|
615
|
-
*
|
|
616
|
-
*
|
|
617
|
-
*
|
|
618
|
-
*
|
|
619
|
-
* mouseWheel: "none" // Disable zooming with the mouse wheel
|
|
620
|
-
* },
|
|
621
|
-
* browserTouchPanEnabled: false,
|
|
622
|
-
* momentumEnabled: false,
|
|
623
|
-
* }
|
|
624
|
-
* });
|
|
623
|
+
* const viewElement = document.querySelector("arcgis-map");
|
|
624
|
+
* viewElement.navigation = {
|
|
625
|
+
* gamepad: {
|
|
626
|
+
* enabled: false
|
|
627
|
+
* },
|
|
628
|
+
* actionMap: {
|
|
629
|
+
* dragSecondary: "none", // Disable rotating the view with the right mouse button
|
|
630
|
+
* mouseWheel: "none" // Disable zooming with the mouse wheel
|
|
631
|
+
* },
|
|
632
|
+
* browserTouchPanEnabled: false,
|
|
633
|
+
* momentumEnabled: false,
|
|
634
|
+
* };
|
|
635
|
+
* ```
|
|
625
636
|
*/
|
|
626
637
|
accessor navigation: Navigation;
|
|
627
638
|
/**
|
|
@@ -731,22 +742,32 @@ export abstract class ArcgisMap extends LitElement {
|
|
|
731
742
|
*
|
|
732
743
|
* @default 0
|
|
733
744
|
* @example
|
|
734
|
-
*
|
|
735
|
-
*
|
|
745
|
+
* ```html
|
|
746
|
+
* <!-- Due north is rotated 90 degrees, pointing to the right side of the view -->
|
|
747
|
+
* <arcgis-map basemap="satellite" rotation="90"></arcgis-map>
|
|
748
|
+
* ```
|
|
736
749
|
* @example
|
|
750
|
+
* ```js
|
|
737
751
|
* // Due north is rotated 180 degrees, pointing to the bottom of the view
|
|
738
|
-
*
|
|
752
|
+
* viewElement.rotation = 180;
|
|
753
|
+
* ```
|
|
739
754
|
* @example
|
|
755
|
+
* ```js
|
|
740
756
|
* // Due north is rotated 270 degrees, pointing to the left side of the view
|
|
741
|
-
*
|
|
757
|
+
* viewElement.rotation = 270;
|
|
758
|
+
* ```
|
|
742
759
|
* @example
|
|
760
|
+
* ```js
|
|
743
761
|
* // Due north is rotated 0 degrees, pointing to the top of the view (the default)
|
|
744
|
-
*
|
|
762
|
+
* viewElement.rotation = 0; // 360 or multiple of 360 (e.g. 720) works here as well.
|
|
763
|
+
* ```
|
|
745
764
|
* @example
|
|
765
|
+
* ```js
|
|
746
766
|
* // Disables map rotation
|
|
747
|
-
*
|
|
767
|
+
* viewElement.constraints = {
|
|
748
768
|
* rotationEnabled: false
|
|
749
769
|
* };
|
|
770
|
+
* ```
|
|
750
771
|
*/
|
|
751
772
|
accessor rotation: number;
|
|
752
773
|
/**
|
|
@@ -842,12 +863,14 @@ export abstract class ArcgisMap extends LitElement {
|
|
|
842
863
|
* @see [Theme](https://developers.arcgis.com/javascript/latest/references/core/views/Theme/)
|
|
843
864
|
* @see [Sample - Color theming for interactive tools](https://developers.arcgis.com/javascript/latest/sample-code/view-theme/)
|
|
844
865
|
* @example
|
|
866
|
+
* ```js
|
|
845
867
|
* // Update the theme to use purple graphics
|
|
846
868
|
* // and slightly transparent green text
|
|
847
869
|
* view.theme = new Theme({
|
|
848
870
|
* accentColor: "purple",
|
|
849
871
|
* textColor: [125, 255, 13, 0.9]
|
|
850
872
|
* });
|
|
873
|
+
* ```
|
|
851
874
|
*/
|
|
852
875
|
accessor theme: Theme | null | undefined;
|
|
853
876
|
/**
|
|
@@ -858,23 +881,21 @@ export abstract class ArcgisMap extends LitElement {
|
|
|
858
881
|
*
|
|
859
882
|
* @since 4.12
|
|
860
883
|
* @example
|
|
884
|
+
* ```js
|
|
861
885
|
* // Create a csv layer from an online spreadsheet.
|
|
862
|
-
*
|
|
886
|
+
* const csvLayer = new CSVLayer({
|
|
863
887
|
* url: "http://test.com/daily-magazines-sold-in-new-york.csv",
|
|
864
888
|
* timeInfo: {
|
|
865
889
|
* startField: "SaleDate" // The csv field contains date information.
|
|
866
890
|
* }
|
|
867
891
|
* });
|
|
892
|
+
* viewElement.map.add(csvLayer);
|
|
868
893
|
*
|
|
869
|
-
*
|
|
870
|
-
*
|
|
871
|
-
*
|
|
872
|
-
*
|
|
873
|
-
*
|
|
874
|
-
* start: new Date("2019, 2, 24"),
|
|
875
|
-
* end: new Date("2019, 2, 31")
|
|
876
|
-
* }
|
|
877
|
-
* });
|
|
894
|
+
* viewElement.timeExtent = {
|
|
895
|
+
* start: new Date("2019, 2, 24"),
|
|
896
|
+
* end: new Date("2019, 2, 31")
|
|
897
|
+
* };
|
|
898
|
+
* ```
|
|
878
899
|
*/
|
|
879
900
|
accessor timeExtent: TimeExtent | null | undefined;
|
|
880
901
|
/**
|
|
@@ -885,12 +906,11 @@ export abstract class ArcgisMap extends LitElement {
|
|
|
885
906
|
* @default "system"
|
|
886
907
|
* @see [wikipedia - List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
|
|
887
908
|
* @example
|
|
909
|
+
* ```js
|
|
888
910
|
* // Date and time will be displayed in Pacific/Auckland (NZ) time zone
|
|
889
|
-
* const
|
|
890
|
-
*
|
|
891
|
-
*
|
|
892
|
-
* timeZone: "Pacific/Auckland"
|
|
893
|
-
* });
|
|
911
|
+
* const viewElement = document.querySelector("arcgis-map");
|
|
912
|
+
* viewElement.timeZone = "Pacific/Auckland";
|
|
913
|
+
* ```
|
|
894
914
|
*/
|
|
895
915
|
accessor timeZone: string;
|
|
896
916
|
/**
|
|
@@ -1000,10 +1020,9 @@ export abstract class ArcgisMap extends LitElement {
|
|
|
1000
1020
|
* **2D hitTest() behavior by layer type**
|
|
1001
1021
|
* | Layer type | Hit test behavior |
|
|
1002
1022
|
* | :--- | :--- |
|
|
1003
|
-
* | [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer), [CatalogFootprintLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer), [CSVLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CSVLayer), [GeoJSONLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeoJSONLayer), [OGCFeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/OGCFeatureLayer), [OrientedImageryLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/OrientedImageryLayer), [StreamLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/StreamLayer), [SubtypeGroupLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/SubtypeGroupLayer), [WFSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WFSLayer) | Returns all intersecting [GraphicHit](https://developers.arcgis.com/javascript/latest/references/core/views/types/#GraphicHit) features at the hit location. |
|
|
1004
|
-
* | [ParquetLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ParquetLayer) | Returns only the topmost [GraphicHit](https://developers.arcgis.com/javascript/latest/references/core/views/types/#GraphicHit) feature when the hit occurs on overlapping features. (as of version 4.34). |
|
|
1023
|
+
* | [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer), [CatalogFootprintLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer), [CSVLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CSVLayer), [GeoJSONLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeoJSONLayer), [OGCFeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/OGCFeatureLayer), [OrientedImageryLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/OrientedImageryLayer), [ParquetLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ParquetLayer), [StreamLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/StreamLayer), [SubtypeGroupLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/SubtypeGroupLayer), [WFSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WFSLayer) | Returns all intersecting [GraphicHit](https://developers.arcgis.com/javascript/latest/references/core/views/types/#GraphicHit) features at the hit location. |
|
|
1005
1024
|
* | [GeoRSSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeoRSSLayer), [GraphicsLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GraphicsLayer), [KMLLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/KMLLayer), [MapNotesLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/MapNotesLayer) | Returns all intersecting [GraphicHit](https://developers.arcgis.com/javascript/latest/references/core/views/types/#GraphicHit) features at the hit location. |
|
|
1006
|
-
* | [ImageryLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ImageryLayer), [ImageryTileLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ImageryTileLayer)| Returns [RasterHit](https://developers.arcgis.com/javascript/latest/references/core/views/types/#RasterHit) result containing raster pixel value used in rendering and bandId info on intersecting pixels. The `screenRect` hitTarget
|
|
1025
|
+
* | [ImageryLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ImageryLayer), [ImageryTileLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ImageryTileLayer)| Returns [RasterHit](https://developers.arcgis.com/javascript/latest/references/core/views/types/#RasterHit) result containing raster pixel value used in rendering and bandId info on intersecting pixels. The `screenRect` hitTarget returns hit result at the center of the rectangle. |
|
|
1007
1026
|
* | [VectorTileLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/VectorTileLayer) | Returns a result for all intersecting [GraphicHit](https://developers.arcgis.com/javascript/latest/references/core/views/types/#GraphicHit) features containing attributes of style layers (as of version 4.29; in prior releases, only the topmost style layer result was returned). In addition, the graphic's [origin](https://developers.arcgis.com/javascript/latest/references/core/Graphic#origin) contains the style layer's [id](https://maplibre.org/maplibre-style-spec/layers/#id) and layer index within the [vector tile style](https://doc.arcgis.com/en/arcgis-online/reference/tile-layers.htm#ESRI_SECTION1_8F68399EB47B48FF9EF46719FCC96978). Spatial information about the actual feature represented in the style layer is returned only if the style layer is a [symbol layer](https://maplibre.org/maplibre-style-spec/layers/#symbol). Otherwise, the graphic's geometry is `null`. |
|
|
1008
1027
|
* | [MediaLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/MediaLayer) | Returns [MediaHit](https://developers.arcgis.com/javascript/latest/references/core/views/types/#MediaHit) result containing all media elements if the hit is made on intersecting elements. |
|
|
1009
1028
|
* | [RouteLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/RouteLayer) | Returns [RouteHit](https://developers.arcgis.com/javascript/latest/references/core/views/types/#RouteHit) result containing all intersecting route elements if the hit is made on intersecting elements. |
|
|
@@ -1019,18 +1038,20 @@ export abstract class ArcgisMap extends LitElement {
|
|
|
1019
1038
|
*
|
|
1020
1039
|
* @param hitTarget
|
|
1021
1040
|
* @param options
|
|
1041
|
+
* @see [Sample - Access features with hitTest](https://developers.arcgis.com/javascript/latest/sample-code/map-component-hittest/)
|
|
1042
|
+
* @see [Sample - Hit test features by screen rectangle](https://developers.arcgis.com/javascript/latest/sample-code/map-hittest-screen-rectangle/)
|
|
1043
|
+
* @see [Sample - VectorTileLayer hitTest](https://developers.arcgis.com/javascript/latest/sample-code/layers-vectortilelayer-hittest/)
|
|
1022
1044
|
* @example
|
|
1023
1045
|
* ```js
|
|
1024
|
-
* viewElement.addEventListener("arcgisViewClick", (event) => {
|
|
1025
|
-
* viewElement.hitTest(event.detail)
|
|
1026
|
-
*
|
|
1027
|
-
*
|
|
1028
|
-
*
|
|
1029
|
-
*
|
|
1030
|
-
*
|
|
1031
|
-
*
|
|
1032
|
-
*
|
|
1033
|
-
* });
|
|
1046
|
+
* viewElement.addEventListener("arcgisViewClick", async (event) => {
|
|
1047
|
+
* const response = await viewElement.hitTest(event.detail);
|
|
1048
|
+
* const result = response.results[0];
|
|
1049
|
+
* if (result?.type === "graphic") {
|
|
1050
|
+
* const { longitude, latitude } = result.mapPoint;
|
|
1051
|
+
* console.log(`Hit graphic at (${longitude}, ${latitude})`, result.graphic);
|
|
1052
|
+
* } else {
|
|
1053
|
+
* console.log("Did not hit any graphic");
|
|
1054
|
+
* }
|
|
1034
1055
|
* });
|
|
1035
1056
|
* ```
|
|
1036
1057
|
* @example
|