Select to view content in your preferred language

eDraw widget

81176
250
Jump to solution
02-24-2015 01:17 AM
Labels (1)
JeremieCornet1
Frequent Contributor

Ehanced draw widget for WebApp Builder for Arcgis

UPDATE 2018/05/09 (new Release v2.8.1) :

  • refactoring
  • use esri/geometry/projection (available since esri js api 3.24) instead of proj4js (external libs)
  • systematic use of geometry engine (no more mercator utils, geometry server...)
  • for polyline, the user can now add an arrow (available since esri js api 3.23)
  • live measure while drawing
  • WARNING : this release needs Esri API >= 3.24

Release 2.8.1 on Github 

(Direct zip link : https://github.com/magis-nc/esri-webappbuilder-widget-eDraw/releases/download/v2.8.1/eDraw.zip )

Demo : https://apps.magis.nc/demo/eDraw/ 

Github  :

https://github.com/magis-nc/esri-webappbuilder-widget-eDraw

Wigdet's Features (improvments of standard Draw widget) :

  • add name and description fields on drawings
  • enable infowindow on drawings (selection)
  • on text drawing, no insert if no name.
  • on modification : enable geometry update (with snapping if wanted : CTRL) and preview symbology changes on the fly
  • list
    • add list of all drawings
    • actions on each drawing : modify / delete / [up / down] / zoom
    • all drawings : zoom, copy, delete, export
    • on drawing infowindow -> select drawing in list
    • on zoom on a drawing -> select drawing on map (and show infoWindow)
    • re-order graphics with drag&drop
  • import/export : allow users to export or import drawings (json format)
    • import can be done with file drag&drop in import popup
  • localStorage
    • dynamic saving on each drawing add/delete/update
    • on widget load : load drawings saved in local Storage
  • draws plus (initially from Larry Stout https://geonet.esri.com/people/Larry_Stout)
    • preview under mouse when adding text or point
    • for text, add font choice, font angle, bold, italic, placement and underline options.
    • add arrow menu for polyline
  • checkbox to hide drawing's layer (and therefore widget UI)
  • add of Nautical unit
  • measure's for points/polylines/polygons with automatic update on element's update (or delete). Measure's can be indidualy disabled/enabled on any graphic.
  • "On the fly" measure when drawing
  • defaults symbols can be specified in config's file
  • use of builtin projection engine (available since esri js api 3.24) instead of proj4js library

This message was updated by Jeremie Cornet (New Release)

250 Replies
JeremieCornet1
Frequent Contributor

Hi Adam

1. It's not possible now but i will add this functionnality.

2. I add it to the todolist for measurement's refactoring.

3 & 4. Could you test with standard draw and measure widgets ?

The measurements are calculated with webMercatorUtils.webMercatorToGeographic(geometry) and

geodesicUtils.geodesicLengths.

esri/geometry/webMercatorUtils | API Reference | ArcGIS API for JavaScript

esri/geometry/geodesicUtils | API Reference | ArcGIS API for JavaScript

And could you test with a map in metric system ?

5. Not possible now but i will add this functionnality.

0 Kudos
AdamGebhart
Frequent Contributor

Jeremie:

Thank you for looking into my questions.  Please know they were just wishlist items though and anything you can incorporate into future releases is extremely appreciated.

I tested the standard Draw and Measurement widgets and received distance and area measurements that are in-line with what they should be.  I then re-tested the eDraw widget and got the following measurements:

Distance

actual distance = 125' or 38.1m

measured distance1 = 407'

measured distance2 = 124m

Area

actual area = 12500 sq ft or 1,161sq m

measured area1 = ~132,000 sq ft

measured area2 = ~12,250 sq m

Thanks again.

0 Kudos
by Anonymous User
Not applicable

I haven't looked at the code yet.. but is it potentially hardwired to expect web mercator? I had this problem too, on my  Pictometry widget.  I realized I had to tell it to take the map.spatialreference as input then convert to what my spatial ref was (GA state plane).  Maybe this is useful. I will follow up on this and look into the code perhaps in the next day or so.

0 Kudos
JeremieCornet1
Frequent Contributor

As eDraw is a fork of standard Draw widget, the measure part is inherited from the Draw widget, but the WAB 1.0 one...

I just looked the measure code in Draw widget (WAB 1.2) and there are lots of change including the use of a GeometryService if needed.

I have to update my eDraw widget with this modifications.

I will do that as soon as possible but i haven't time this days...

0 Kudos
IandeNeeve1
Occasional Contributor

Hi Jeremie!

The original question was asked a few years ago, but i haven't seen any follow up on it. Is it possible to enable multi-line text? My non-GIS map-makers are not happy with making a paragraph out of single lines cobbled together into a block.

Also, is it possible to control for placement of text while the user zooms in or out? 

JeremieCornet1
Frequent Contributor

Adam GebhartKevin MacLeod​ and others

For the measurment's issue :

I have updated the measure's mechanism from the standard Draw widget (WAB 1.2).

After that, i've added support for the API esri.geometrygeometryEngine(client side).

( /!\ The widget now needs esri JS API >= 3.13 )

And i've added settings' UI for setting geometry service and to choose if you want to use geometryEngine (client side but beta.) or not (a combinaison between client side for WGS84 or mercator and server side for others projections).

Could you please test it before i release ? (and test the 2 options : geometryEngine or geometry service)

The zip : https://github.com/magis-nc/esri-webappbuilder-widget-eDraw/archive/v1.3.3.zip

And for information,  the code's changes :

Measurement mechanism update : · magis-nc/esri-webappbuilder-widget-eDraw@528177a · GitHub

by Anonymous User
Not applicable

Jeremie Cornet roger that, I am tested it on WAB 1.2. I isolated the error on my setup:

Our service, Geometry Engine not checked, length and area work perfectly. With the ESRI service, and again Geometry Engine is not checked, both work.

However, with either service, if the Geometry Engine is checked, the measurements are wrong.

When using the local GeometryEngine, it overestimates, rather inflates, the measurement by about 50%. Adam Gebhart​ you are not seeing that?  The layers I bring in to WAB is GA State Plane East if this matters.

I will take a look at the code in a bit, but I am wondering, does it get the current map.spatialreference? And reproject to web mercator? Can it do that locally or does it need to call a geometryservice to reproject? If we can't reproject locally, then perhaps the best thing to do for now would be to put in a simple If statement, which would remove the Add Measurements, if the local geometryEngine functionality is used.

Can I just say, thank you again for the great work. I really like seeing Measure and Draw integrated, this is such a nice widget. Great interface design too.

Oh, may I ask Jeremie, if you are in and tinkering with the code, do you plan to add Measurement to the Point?

And... I know this next question is more complex, but once this can measure Segments this will be the only measurement tool we need, I wonder if we can add that as well. We use Tom Sellsted​ 's widget now for measuring Segments, although it would seem logical to combine this into the widget as well, to make one super-Widget for all measure and drawing.

edit: I looked at Tom's widget, it appears to measure locally. It is nice how it dynamically updates the segment measurement texts as well.

Great work everyone. Really loving WAB & community!

0 Kudos
AdamGebhart
Frequent Contributor

Jeremie Cornet​ & Kevin MacLeod

Thanks for the updates.  Everything is looking good for me so far in WAB Developer.  I have tested distance with the two-point line feature (in feet) and area with the freehand polygon feature (in acres and sq ft) under the following settings and received measurements that were correct or very close to what they should be, subject to my digitizing abilities:

[//tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer,

Use geometry engine (not checked)]

[//tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer,

Use geometry engine (checked)]

[my geometry service,

Use geometry engine (not checked)]

[my geometry service,

Use geometry engine (checked)]

Is there anything else I should test?

Jeremie, like Kevin said, this widget is great and with a few more tweaks would probably be all we need for measuring and drawing.  And, just like Kevin, I currently have your eDraw widget and Tom Sellsted​ 's Measure widget in my application.  They're both great but it would be even better if we could get it down to one widget.  This is coming from somebody (me) who hasn't created a widget though so I don't know how much of a hassle it is to create it and keep tweaking it for others.

One question about the snapping capabilities - can you snap to features in the map services or can you only snap to other features created in the eDraw widget?

Again Jeremie, thank you.

by Anonymous User
Not applicable

It works for me with both if Geometry Engine is not checked.  With Geometry Engine checked, with either service, it broke it for me, it is overmeasuring by about 50%.. so you are not seeing that Adam Gebhart​ ? 

I did it in Chrome and also in Feet if this is useful.

0 Kudos
AdamGebhart
Frequent Contributor

Kevin MacLeod

I just tried a couple measurements again (in Firefox & Chrome) and it is working for me with the same settings that I listed above.

0 Kudos