anyone have this done already?
I modified the Draw Widget, so that is it completely custom, and I have made it add the output to table of contents (Feature Layer),
anyways, my question is, does anyone know how to make the graphics editable? (I am aware of a context menu, but just wondering if anyone has done it yet, I have seen it in the eDraw widget, but not the Draw widget)?
Thanks,
Solved! Go to Solution.
Hey All,
I solved it, I basically figured out an alternative to updating the operational layers
this was solved by creating an edit button and save button in the widget
Douglas,
The eDraw is based off of the otb draw widget so should be able to borrow code from it.
yup, I borrowed the code from it, but its doing something rather funny, perhaps you might know what it is,
I am able to edit the graphic (only able to edit vertices, the move, rotate, and scale options do not work),
I am using something along these lines (same as eDraw widget)
editorActivateGeometryEdit : function (graphic) {
if (!graphic)
this.editorActivateSnapping(false);
if (!graphic && this._editorConfig["editToolbar"]) {
this._editorConfig["editToolbar"].deactivate();
return;
}
var tool = 0 | Edit.MOVE;
if (graphic.geometry.type != "point")
tool = tool | Edit.EDIT_VERTICES | Edit.SCALE | Edit.ROTATE;
var options = {
allowAddVertices : true,
allowDeleteVertices : true,
uniformScaling : true
};
this._editorConfig["editToolbar"].activate(tool, graphic, options);
},
but I am not able to actually rotate, move or scale, only move vertices,
probably something stupidly simple.
thanks for the help, let me know
Douglas,
So you are not getting the extent box around the geometry with handles for re-sizing and rotating? Like in this image?
Exactly,I have been testing different things and I have only been able to edit vertices
Douglas,
do you mean something like this ArcGIS Web Application just right click the graphic you have created.
You can get the code here Enhanced Draw Widget
Tim
Hey Tim,
looks like your right, I originally had taken the code from the Draw Widget, and enhanced draw widget,
I am still somewhat puzzled why I can only use the Edit.MOVE_VERTICES handle in my code, but the move, rotate, and scale wont work,
perhaps its because you have the OnOpen method and you set
var map = this.map;
editToolbar = new Edit(map);
where I have my editToolbar initialization in the PostCreate Method.
I will keep posted with any updates, but I am assuming this will solve my issue based on the code.
or
have any if you guys had luck with enabling the edit toolbar for operational layers?? (created via draw widget)? I have modified AdvDraw widget and Draw Widget, but still no luck for editing operational layers (created from graphics), editing graphics are no issue, just operational layers
Douglas,
No I personally have not but I will do some testing when time permits and report back.
Hey All,
I solved it, I basically figured out an alternative to updating the operational layers
this was solved by creating an edit button and save button in the widget