Select to view content in your preferred language

eDraw widget

81171
250
Jump to solution
02-24-2015 01:17 AM
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 Kevin,

I cannot reproduce this.

Tested on Firefox, Chrome and IE.

Could you tell me more about your context ? (browser, WAB version, WAB theme...)

@others Do you have this bug ? In which context ?

by Anonymous User
Not applicable

Jeremie Cornet​ I created a blank new app in WAB12 (Default theme all defaults). Added new eDraw 1.3.3 10/22.  After adding a Text, the Point doesn't work. Actually clicking it brings up the Draw tab in fact.

ArcGIS Web Application 

So, then I just took an existing demo site (a test site built with WAB 1.2 to show my Query), then I duplicated it and changed the folder name on my server. So, a complete WAB site. Then, I deleted the eDraw widget folder (which was your pre-release eDraw 1.3.3 version you asked us to try earlier in the thread..I'll call it September 1.3.3 eDraw..)  I then copied in your new eDraw 1.3.3 10/22.  And... it seems to work! Just fine.

ArcGIS Web Application

I even copied the new config.json from this one that works, to the first one above, and it still didn't fix it.

So... I guess for now, I'll just manually copy in your eDraw to new WAB sites I build, after I download it out of WebApp Builder.  It's probably not your code, given all this.  Something's probably gotten messed up in my WAB. Anyway, since no one else sees it, and I can fix it with this workaround for now, I will assume it's my WAB or something specific to my settings with eDraw and not worry about it or test it further, unless you would like me to do something specific.   Maybe I will build a completely fresh WAB folder, the next time ESRI updates (1.3).

update: Actually this is a problem. The real site I am building is internal. Just copying fresh 1.3.3. eDraw in didn't change anything. I noticed a difference. For the site that eDraw works, it has a eDraw folder in the site "configs" folder. I.e. if the site is named MySite it's MySite/configs/eDraw/config_Draw.json   However removing that file breaks the widget it won't initialize. But the weird thing is, the site where eDraw works doesn't have the file or folder in Configs. And yet.. it works just fine. Sorry if this is confusing. I will try to figure it out.

0 Kudos
JeremieCornet1
Frequent Contributor

Kevin MacLeod

The config file comes from WAB.

When you add a widget in builder, WAB uses the default configuration of the widget (config.json in widget's folder).

But if you edit the widget's configuration in builder, WAB create a config file in /configs/widgetName/

So eDraw doesn't work because it doesn't like your old config file (MySite/configs/eDraw/config_Draw.json).

Could you send me it ? I want the widget to be capable to use "old" config's file.

0 Kudos
by Anonymous User
Not applicable

Hi Jeremie,

This one does not work - http://sagiscloud.thempc.org/eDraw_133_WAB12.zip 

this one works - http://sagiscloud.thempc.org/eDrawDemo.zip

Not sure why, what do you think? The problem, is that whatever I do, when I the new eDraw to a third site (an internal one I am building), the Text/Point bug persists. Removing the json config file in Configs folder simply breaks the whole widget. So I guess it has something wrong in it? Note.. I haven't edited it manually or anything, just always configured it normally in side WAB 1.2.

I thought hm maybe it is one of the settings. But no luck, I copied the new 10/22 edraw and the config file the WORKED in the other site into my internal viewer. I changed operationallayer to false from true, geometryservice local and not, etc nothing fixed the bug. Which is weird, it seems like maybe it is something else in the site and not the eDraw widget itself?

0 Kudos
MihkelMänna
Frequent Contributor

Kevin MacLeod

Jeremie Cornet

I have also experienced the kind of Text-Point errors that Kevin was talking about. Plus I found another bug that prevents from adding a point. When choosing Add symbol -> Point -> Cancel -> Text -> Cancel -> Point -> Add point to map, text will be added to map. Any ideas, what could cause this?

EDIT: And after this, adding points is completely impossible.

0 Kudos
by Anonymous User
Not applicable

exactly. the Text kills the Point's click handler.  Even if cancelled. As soon as you get to Text the Point click handler has been killed.

I download a fresh copy of the widget in to a fresh new WAB1.2 site it is ok. But my darn current site, the internal one, I can not get to work. I download the 10/22 and put it in and as above this bug persists. As in my two links above. I could not figure it out.

0 Kudos
MihkelMänna
Frequent Contributor

For me, it's the line in the editorSymbolChooserConfigure function:

//Force editorSymbolChooser _init to walk around jimu.js bug (initTextSection doesn't pass symbol to _initTextSettings)
this.editorSymbolChooser._initTextSettings(symbol);

After removing this, things seem to be working fine. Is this really necessary?

AlphonseATTRON
Deactivated User

Hi Jeremie,

Thanks for the widget, great !!.

Is it possible to change the icon for Point symbol? or Loading my own symbols?

Regards,

StanMcShinsky
Frequent Contributor

Alphonse ATTRON

This should do the trick Adding custom icons to the draw tool

-Stan

AlphonseATTRON
Deactivated User

Thanks Stan, It is exactly what I was looking for. Excellent

You saved my day

0 Kudos