Select to view content in your preferred language

Is it Possible to Have ArcGIS JS API Measure a New Feature as it's Being Drawn?

448
6
Jump to solution
03-14-2023 01:02 PM
GraceTortorici_
New Contributor III

Hi all,

 

Is it possible to integrate the Editor Widget and Measure Widget so that when a new feature is being drawn, the measurements are automatically being displayed? I have not been able to successfully implement this.

 

Any insights would be appreciated!

0 Kudos
1 Solution

Accepted Solutions
AnneFitz
Esri Regular Contributor

Hi @GraceTortorici_ - we added support for tooltipOptions on the Editor widget at version 4.24, which will display area and length measurements in a tooltip when creating or editing a feature. To enable this, follow the code snippet shown below: 

const editor = new Editor({
   view: view,
   layerInfos: [pointInfos, lineInfos, polyInfos],
   tooltipOptions: {
      enabled: true
   }
});

Here's an example: https://codepen.io/annefitz/pen/dyqmrLd?editors=1000

View solution in original post

0 Kudos
6 Replies
AnneFitz
Esri Regular Contributor

Hi @GraceTortorici_ - we added support for tooltipOptions on the Editor widget at version 4.24, which will display area and length measurements in a tooltip when creating or editing a feature. To enable this, follow the code snippet shown below: 

const editor = new Editor({
   view: view,
   layerInfos: [pointInfos, lineInfos, polyInfos],
   tooltipOptions: {
      enabled: true
   }
});

Here's an example: https://codepen.io/annefitz/pen/dyqmrLd?editors=1000

0 Kudos
GraceTortorici_
New Contributor III

Hi @AnneFitz, is there a way to change the units from m and km to feet using the tooltip option? I tried using 

    linearUnit: "feet",
    areaUnit: "square-feet"

but this was not successful. Unfortunately not finding any documentation on this. Thanks so much!

 


0 Kudos
AnneFitz
Esri Regular Contributor

This is currently a limitation - we are still working on the tooltip functionality and will add the ability to change the units at an upcoming release! Stay tuned.

SergioSalmeron_NTT
New Contributor III

¿en qué versión estará disponible?

0 Kudos
SergioSalmeron_NTT
New Contributor III

What version will it be available in?

0 Kudos
GraceTortorici_
New Contributor III

@AnneFitz thanks so much, this is perfect!

0 Kudos