Select to view content in your preferred language

Creating a custom Map Component

389
2
Jump to solution
12-06-2024 10:59 AM
DavidOke
Emerging Contributor

I'm working with the new map components @ @https://developers.arcgis.com/javascript/latest/references/map-components/?path=/docs/welcome--do

Is there any documentation on how to create a custom component using the map component paradigm (I.e. what's required to make "MyNewComponent" below work)? The old way was pretty clear with view.ui.add(...). This is a little different:

 

<ArcGisMap itemId={itemId}>

  <MyNewComponent position="top-left" />

</ArcGisMap>

 

Thanks!

0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Esri Frequent Contributor

Currently, you can use the arcgis-placement component for this.

<arcgis-map>
    <arcgis-placement position="top-right">
        <my-custom-component></my-custom-component>
    </arcgis-placement>
</arcgis-map>

 

View solution in original post

2 Replies
ReneRubalcava
Esri Frequent Contributor

Currently, you can use the arcgis-placement component for this.

<arcgis-map>
    <arcgis-placement position="top-right">
        <my-custom-component></my-custom-component>
    </arcgis-placement>
</arcgis-map>

 

DavidOke
Emerging Contributor

Thanks! Works perfectly in react and even gets me a reference to the map.

0 Kudos