Measurement Widget EB 1.9.0

5506
16
05-27-2021 12:04 PM

Measurement Widget EB 1.9.0

All,

   Here is my next EB widget for all of you to use.

Note: This is an EB 1.9 Widget (not tested for backward compatibility).

Measurement.jpg

  • The widget allows you to measure in a 2D map view.
  • You can measure length, area, and location.
  • The widget allows you to change the displayed measurement results at runtime.
  • You can add custom location units to display the location results in a different projection then the map view (i.e. add a projected coordinate system like State Plane).
  • You can configure which measurement tools are visible.
  • You can define the default measurement unit for distance and area measurements.
  • You can set the measurements drawing colors (i.e. path and fill color).

To install this widget extract the contents of the zip file to your EB\client\your-extensions\widgets. So once you extract the whole path would look like: \client\your-extensions\widgets\measurement. Refresh your client and server windows (easiest way is to close both and 'npm start' them like you normally do to start EB). Now the measurement widget will appear in your apps widget menu. Add the widget to your app. Now use the widgets settings panel to configure the widget.

 

Enjoy, Robert

Attachments
Comments

Great work!

@RobertScheitlin__GISP dropping a "thank you" for your custom Measurement widget!  It helped fix the broken widget available in Experience Builder.

Robert did you notice that ExB 1.9 upgrade seems to have caused an issue with you Measurement Tool.  It is just giving the ESRI 3 blue lines when I run it.

I wanted to let you know I figured it out.  The esri/task items had to be pointed to esri/rest, plus one of the methods changed the parameter for setting url for geometry server.  It is working now.

@KoreyAlleman1 Hi ! I am a beginner and I would like to know what changes to make in methods please ?

@LabastieMarie Version 1.9 is ready to use (no code changes needed).

Robert, the attached file appears to be the Draw widget instead of Measure. (Which is also an awesome tool.)
AndyWells_0-1664300560965.png

 

@AndyWells 

Sorry for the delay. I have been away for a few weeks. Correct zip file should be attached now.

Robert

It doesn't seem like the measure widget is working with Experience builder 1.10. I've tried it in a few projects and when you click to start a measurement, it just acts as a normal select on the map. I have tried reinstalling it.

Thanks for all you have done!

Hi Robert,

 

I downloaded Experience Builder Developer Edition 1.11 (April 2023) and found that it broke your Measurement Widget EB 1.9.0.

 

When I attempt to draw a line or polygon the associated graphics do not show up.

 

Measure a Line

 

I see the distance is being calculated correctly. However, the graphics are not showing up.

 

DavidDas__GISP_0-1679334772061.png

 

 

Measure an Area

 

I see that the Measurement widget is reporting the Area and Perimeter, but the graphics I am drawing on the map are not showing up.

 

DavidDas__GISP_1-1679334772067.png

 

 

 

Measure a Point

 

I do see the point on the map.

This is working.

 

DavidDas__GISP_2-1679334772069.png

 

Best regards,

David Das

 

@AndyWells  @DavidDas__GISP 

Unfortunately every ArcGIS Experience Builder Developer Edition release had some minor or major breaking changes from previous version. It means that custom widgets have to be little bit modified everytime the new release come up. We hope the breaking changes won't be that often as we can see it now. For instance ArcGIS Web AppBuilder Developer Edition had little or no breaking changes in the latest releases. Maybe @Jianxia could tell us more about future plans to have/not to have breaking changes in the future ArcGIS Experience Builder Developer Edition releases.

@JanSarata , a good point. Currently ExB is in the rapid development. Like ArcGIS Maps SDK for JavaScript, breaking changes most likely will continue to happen. We will try our best to mitigate their impacts. Thanks for letting us know your concerns.

@Jianxia Thank you for your answer and clarification. I totally understand the needs for breaking changes. I appreciate they are always well documented.

Hi, I tried to use this measurement widget in EB 1. 11. But it is showing below error in console. Can anyone help me how to resolve the issue. 

Error: [esri.core.accessorSupport.ensureTypes] Accessor#set Assigning an instance of 'esri.geometry.SpatialReference' which is not a subclass of 'esri.geometry.SpatialReference'

EthanJoe_0-1694581020975.png

Thankyou

The measurement widget dose not work in my EB 1.12 developer version. Does anyone could make it work?

Thanks

Zhujing

@RobertScheitlin__GISP I tried the custom measurement widget. It's working for me. But I need to translate the widget into Arabic. I am able to translate the contents in the point tool. But the issue is, How can I translate the contents and units in area and distance tools to Arabic?
In the default measurement widgets, all contents are translated including the units.

Version history
Last update:
‎09-29-2022 01:30 PM
Updated by: