Features component

This sample shows how to utilize the Features component to allow the exploration of a feature's PopupTemplate content outside of the map. The Features component should be used if Popup functionality is needed outside of the map.

The data used in this sample is from the National Park Service showing National Park boundaries alongside trails within each park. The popup content was preconfigured in an ArcGIS Online webmap and contains an Arcade element that returns text, a media element with charts, and a relationship element to display the related trails within each park.

How it works

Add a Features component to a Calcite Design System shell and reference the map component which contains the webmap with National Park data.

Use dark colors for code blocksCopy
1
<arcgis-features class="calcite-match-height" reference-element="#parks-map" ></arcgis-features>

Add a custom action to the action bar under the title of the selected feature that opens a specified web page.

Use dark colors for code blocksCopy
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
      // Add a custom action to the actions menu.
      featuresComponent.actions = [
        {
          type: "button",
          title: "Visitor Use Statistics",
          id: "more-info",
          icon: "information-letter"
        }
      ];

Use an arcgisViewClick event listener to watch for a click event on the map component and call the open() method to display the component with features at the clicked location.

Use dark colors for code blocksCopy
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
      // Add an event listener to the map to open the Features component when the user clicks on the map.
      map.addEventListener("arcgisViewClick", (event) => {
        const { mapPoint } = event.detail;
        featuresComponent.open({
          location: mapPoint,
          fetchFeatures: true
        });
      });

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.