function createGraphicsMenu() { // Creates right-click context menu for GRAPHICS ctxMenuForGraphics = new Menu({}); ctxMenuForGraphics.addChild(new MenuItem({ label: "Edit", onClick: function() { if ( selected.geometry.type !== "point" ) { editToolbar.activate(Edit.EDIT_VERTICES, selected); } else { editToolbar.activate(Edit.MOVE | Edit.EDIT_VERTICES | Edit.EDIT_TEXT, selected); } } }));
Looking at the error, it looks like Text editing (maybe all points) requires Edit.EDIT_VERTICES, Edit.EDIT_TEXT (text only?), Edit.MOVE tools n=this._enableBoxEditing(b,c,p);(a&e)===e&&(k=this._enableVertexEditing(b));(a&g)===g&&this._enableTextEditing(b);if(!h&&!k&&!n)throw Error("[esri.toolbars.Edit::activate] Unable to activate the tool. Check if the tool is valid for the given geometry type.");The code below prevents the error, which makes the popup work as expected....function createGraphicsMenu() { // Creates right-click context menu for GRAPHICS ctxMenuForGraphics = new Menu({}); ctxMenuForGraphics.addChild(new MenuItem({ label: "Edit", onClick: function() { if ( selected.geometry.type !== "point" ) { editToolbar.activate(Edit.EDIT_VERTICES, selected); } else { editToolbar.activate(Edit.MOVE | Edit.EDIT_VERTICES | Edit.EDIT_TEXT, selected); } } }));
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.