Select to view content in your preferred language

SketchValueOptions for new arcgis-sketch web component

552
3
05-29-2026 02:25 AM
Insa_bel
Occasional Contributor

Hello!

 

I am currently in the process of migrating our widgets to the new web components. 

While migrating the Sketch Widget, I ran into an issue. I do not see any option anymore to set the SketchValueOptions. We use the valueOptions to change the units for the tooltip to nautical-miles like this:

valueOptions: {
displayUnits: {
length: 'nautical-miles',
area: 'square-nautical-miles'
}
}
 
The only unit related option when working with the arcgis-sketch (that I found) is setting the unit system for the labels (labelOptions) via a PortalItem on the Map?
Insa_bel_0-1780046723266.png


This only works with SceneViews, but we use a MapView. 

I could not find any unit options that only apply to the sketch component directly.

 

Could you please help me out there?

0 Kudos
3 Replies
Insa_bel
Occasional Contributor

.

0 Kudos
JeffreyThompson2
MVP Frequent Contributor

The documentation doesn't explain this very well, but all the properties and functions of a Widget should still be accessible in a Component through JavaScript. You just need to use the document.getElementById() method to capture the DOM node of the Component. That DOM node is for all practical purposes the Widget.

const sketchWidget = document.getElementById('sketchComponentId')
sketchWidget.valueOptions = myValueOptions

 

GIS Developer
City of Arlington, Texas
0 Kudos
JoseBanuelos
Esri Contributor

Hello @Insa_bel ,
We are adding this prop to Sketch component in the 5.2 release. We were making some modifications to the SketchValueOptions. I apologize for the inconvenience this has brought for not having this available sooner.

Thanks,

Jose

0 Kudos