Hello,
I would like to change the units displayed on the Sketch widget tooltip from meters to miles. I combed through the documentation and couldn't find any way to configure this. Our application stores the distance and area (plus the units) in miles, but we are having trouble displaying the built-in measurement while drawing in miles.
The tooltip in the screenshot is displayed using the "tooltipOptions={{ enabled: true }}" parameter for the Sketch Widget
The only alternative I found was to make a TextSymbol located at the centroid lat/lng of the polygon. But this felt clunky to implement given there is already a dynamic tooltip in the SDK.
I am running into the same issue. Doesn't appear that it can be changed.
I was able to accomplish this by explicitly setting the valueOptions > displayUnits property for the Sketch class. Here's an example of how I'm using it:
const sketchWidget = new Sketch({
layer: sketchLayer,
view: view,
viewModel: sketchViewModel,
valueOptions: {
displayUnits: {
length: "feet",
area: "acres"
}
},
visibleElements: {
duplicateButton: false,
createTools: {
point: geometryTypes.includes("point"),
polyline: geometryTypes.includes("polyline"),
polygon: geometryTypes.includes("polygon"),
rectangle: false,
circle: false
}
},
defaultUpdateOptions: {
reshapeOptions: {
shapeOperation: "none"
},
enableRotation: false,
enableScaling: false,
enableZ: false,
highlightOptions: {
enabled: false
},
tool: "reshape"
},
creationMode: "update"
});
Here's a link to the documentation - it says it's in beta so perhaps this feature wasn't available when this post was originally made. It's supported since ArcGIS Maps SDK for JavaScript 4.29.
Hope this helps if someone comes across this post in the future!