eDraw widget

72048
250
Jump to solution
02-24-2015 01:17 AM
JeremieCornet1
Occasional Contributor II

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
by Anonymous User
Not applicable

hi Amanda Bentley‌ you add it to the 'widgets' folder in your 'stemapp' folder in your Web AppBuilder folder. 

This guide has step-by-step instructions: ArcWatch | Add Custom Widgets to Web AppBuilder for ArcGIS Developer Edition 

Hope this helps! 

0 Kudos
LauraGuthschmidt
New Contributor III

Hey, I am pretty new to WAB Developer, but I have two question about this widget.


1. I know it is possible to transform the output of json to kml, but I can not find the exact method anywhere (I would need to do this in the widget itself, not after downloading the json file). Can somebody help me with providing the correct place to look? Some threads with the same question that supposedly have an answer are deleted.

2. The json file exports points in WKID 102100, while I need them in long/lat. In the code it seems like the coordinates should be in WKID 4326. Is there a transformation happening in there that I am missing? Or is it just taking the spatial reference of my basemap? If so, how can I make sure that it stops doing this?

Sorry if these questions are dumb, but I am kind of stuck here. Any help would be greatly appreciated!

Thanks

JohnMcCain
New Contributor

Hi Laura,

I am experiencing the same issues as you were with eDraw widget.  Did you figure out how to export and convert all within the widget? Also, I don't understand how the widget formats the JSON file.  It doesn't seem like it's in the correct JSON format. QGIS (which uses the GDAL tool ogr2ogr) can't convert the JSON but ArcMap can.

Thanks for any help you can provide!

0 Kudos
by Anonymous User
Not applicable

Greetings Jeremie Cornet! Some ideas for eDraw.   

1) display measurements for each line segment.  Also, allow measurements to display on an angle. Basically these both mirror Tom's Measure widget. And let us elect whether to make angled measurement text the default.

2) let developers to set the default symbology - i.e. to make all lines purple and text red, so it stands out better and users don't have to use the color picker themselves (as some people will not venture outside the defaults and a color other than black will show better by default).  For Tom's Measure, I was able to easily override the variable. https://public.sagis.org/sagisorg2019/  (though it isn't reflected in the picker, but I settled for this as good enough, it changes if users change it after that)

I looked at your widget.js. I was thinking this was a good place to change it... but...  it ends up permanently changing it.  I can't change it from the graphical interface color picker after this change.  What is a place you would recommend to intercept and set the default color outright, for example for lines, to be purple?

///////////

editorSetDefaultSymbols: function() {
var symbol = this.editorSymbolChooser.getSymbol();
switch (symbol.type.toLowerCase()) {
case "simplemarkersymbol":
this.drawBox.setPointSymbol(symbol);
break;
case "picturemarkersymbol":
this.drawBox.setPointSymbol(symbol);
break;
case "textsymbol":
this.drawBox.setTextSymbol(symbol);
break;
case "simplelinesymbol":
symbol.color.b = "165"; // kevin m
symbol.color.r = "175"; // kevin m
symbol.color.g = "89"; // kevin m

this.drawBox.setLineSymbol(symbol);

break;
case "cartographiclinesymbol":
this.drawBox.setLineSymbol(symbol);
break;

///////

0 Kudos
MartinOwens1
Occasional Contributor II

I've noticed an issues with this widget and was wondering where in widget.js I can modify to fix it. The issue is when you draw a feature with a measurement then attempt to edit/move the text it instantly adds the X&Y location that you can't get rid of. Has anyone else encountered this issue?

0 Kudos
TimConfare2
New Contributor III

Yes, This happens to me as well.

One other issue that I don't believe has been resolved is the printing of lines with arrows.  It shows up fine in the drawing but does not show when printing.

0 Kudos
NormB
by
New Contributor III

Yes, I've noticed this as an issue as well. I've not had a chance to look under the hood for this issue/fix yet.

I am also still noticing the problem with incorrect measurements because of the Planer vs Geodetic issue when using the WGS 84 Web Mercator Coordinate System WKID 3857/102100.  I've read this entire post now a few times and have found some real cherries to pick and implement for fixes, problem is I'm not as savvy as any of the dev folks that have chimed in. I was able to test the measurement problem by going back to an old version (1.3.3, edited by Robert Scheitlin, GISP ) where you have a selection/check box button to use "or not use" the geometry service.  I think I'll be able to implement the fixes outlined by Jeremie Cornet ‌from one of his replies above, it will just take me more time than your average mechanic.

I'm using WAB 2.14, Dart Theme, Edraw 2.8.1, Chrome Version 79.0.3945.88 (Official Build) (64-bit)

Kudos to Jeremie Cornet and others for development efforts and  to everyone that has submitted on this topic since 15'! Now it's on to 2020.

edraw widget

0 Kudos
JhonnyGutierrez
New Contributor

hi...

To fix this issues, update line 1241 of Widget.js:
//this.addMeasure(geom, this._editorConfig["graphicCurrent"]);
if(this.showMeasure.checked){
this.addMeasure(geom, this._editorConfig["graphicCurrent"]);
}

issue in GitHub

0 Kudos
RaoulComaduran2
New Contributor II

Greetings,

Love you draw tool and would love to use in for other apps in our AGOL account. My question is, i currently have it hosted on my Portal account through use of this workflow(Add custom widgets—Portal for ArcGIS | ArcGIS Enterprise ). However, there seems to be a hiccup when trying to add this into AGOL. Now from what i have read, i can deploy it via Web AppBuilder Developer Edition but then in that case, the widget will only be hosted on a local machine and not at an organizational account.

Any thoughts or work arounds on how one would actually try and share this tool in AGOL organizational environment. 

Raoul

0 Kudos
by Anonymous User
Not applicable

We can vote and hope for it  Upload Custom Widgets To ArcGIS Online 

0 Kudos