Ehanced draw widget for WebApp Builder for Arcgis
UPDATE 2018/05/09 (new Release v2.8.1) :
(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) :
This message was updated by Jeremie Cornet (New Release)
Solved! Go to Solution.
I've often longed for having some kind of redline editing tool (short of keeping a junky feature service kicking around) for users to relay edits to our core editing group, so this discussion intrigues me.
Jeremie Cornet would incorporating the arcgis_parser from Terraformer be at all useful for this endeavor?
In the mean time, I may host a GP Service using JSON to Features with some strict user guidelines as Rebecca Strauch, GISP suggested to implement.
Edit: one thing I noticed with the export from the eDraw widget: if you export only polyline features the JSON will contain "paths" objects as expected, and if you export only polygon features the JSON will contain "rings" as expected. However, if you export both polylines and polygons together, the JSON only contains "rings" and thus no polylines are described.
Zachary,
Jeremie touched on this in a comment above (Oct 7)....my guess is these fall under that (even if both are polygons)
JSON to features is the good tool but it doesn't work if there are multiples geometry types in the same json.
You may have to parse the json and separate it by geometry type before to pass it in JSON to Features.
Rebecca Strauch, GISP I did read that, but perhaps I misinterpreted what was said? The way I read this was that within the JSON file you'd be able to parse the output to retrieve the different data types, but that doesn't appear to be the case.
Hi Finbar Gillen,
The easier way (and more customisable) i see : add support in the widget for an export via a gpserver (with the json as input).
It's a cool feature to add. I may add this in a future release (with an example toolbox to publish).
Saving to shapefile, that would be an amazing feature. This eDraw widget will enable many people in multiple departments of ours to be more efficient and empowered with GIS.
We would also use it in the exact way Rebecca Strauch, GISP described; people that need to enter geographic data but do not have Arcmap, this will empower them dramatically. For data input that are not related to the SDE. Rebecca Strauch, GISP thank you, great idea! I can think of multiple departments we can deploy this to. This is just awesome. Finbar Gillen
Another question for you!!! Where in the code can you change the default colour for lines, polygons etc.? I am looking to default all to a red outline with a light red fill with 30% transparency.
Regards,
Finbar
You can modify this in the "drawBoxOnTypeSelected" method.
If you want to modify this, i think the best way is to add a section in the config's file.
Then in the method, you can modify the default symbol if there is a symbol defined in the config's file.
Add in config.json :
"defaultSymbols":{
"SimpleMarkerSymbol":{symbol in json},
"SimpleLineSymbol":{symbol in json},
"SimpleFillSymbol":{symbol in json},
"TextSymbol":{symbol in json}
}
And then replace in the method the switch with :
switch (commontype) {
case "point":
var options =
(this.config.defaultSymbols && this.config.defaultSymbols.SimpleMarkerSymbol)
? this.config.defaultSymbols.SimpleMarkerSymbol
: null;
symbol = new SimpleMarkerSymbol(options);
break;
case "polyline":
var options =
(this.config.defaultSymbols && this.config.defaultSymbols.SimpleLineSymbol)
? this.config.defaultSymbols.SimpleLineSymbol
: null;
symbol = new SimpleLineSymbol(options);
break;
case "polygon":
var options =
(this.config.defaultSymbols && this.config.defaultSymbols.SimpleFillSymbol)
? this.config.defaultSymbols.SimpleFillSymbol
: null;
symbol = new SimpleFillSymbol(options);
break;
case "text":
var options =
(this.config.defaultSymbols && this.config.defaultSymbols.TextSymbol)
? this.config.defaultSymbols.TextSymbol
: {
"verticalAlignment" : "middle",
"horizontalAlignment" : "center"
};
symbol = new TextSymbol(options);
break;
}
If you make this modification, could you make a pull request in github ?
I've added it to the next release . But i hav'nt add UI in settings to manage this default symbols (and will not).
"I've added it to the next release . But i hav'nt add UI in settings to manage this default symbols (and will not)."
If I make adjustments to the default color within the config.json file should this not automatically update the widget. I have edited the code below as I want it to default to a red outline. Or do I have to add a UI section to the HTML?
"defaultSymbols":{
"SimpleMarkerSymbol":{"color":[255, 0, 0],"size":15,"angle":0,"xoffset":0,"yoffset":0,"type":"esriSMS","style":"esriSMSCircle","outline":{"color":[255, 0, 0],"width":0.75,"type":"esriSLS","style":"esriSLSSolid"}},
"SimpleLineSymbol": {"color":[255, 0, 0],"width":1.5,"type":"esriSLS","style":"esriSLSSolid"},
"SimpleFillSymbol": {"color":[255, 0, 0],"outline":{"color":[255, 0, 0],"width":0.75,"type":"esriSLS","style":"esriSLSSolid"},"type":"esriSFS","style":"esriSFSSolid"},
"TextSymbol":false