Hello world !
I create some graphics in my map and it's really cool but after doing it I need to Select the graphic that I just created with all the node hightligted !
My goal is to have something like a really simple Editing session where you can drag'n'drop the nodes of the graphic !
I looked in the API's doc of the graphics but I didn't found anything for the selection/editing ... however I saw some event like graphic-node-add or graphic-node-remove but no method for selecting or editing !
An idea ?
Thank you by advance 😃
Solved! Go to Solution.
You can use the Edit module to do this assuming you are using v3.XX API
Edit | API Reference | ArcGIS API for JavaScript 3.19
Sample
require([
"esri/toolbars/edit", ...
], function(Edit, ... ) {
var editToolbar = new Edit( ... );
//Use the edit toolbar to edit vertices
editToolbar.activate(Edit.EDIT_VERTICES , evt.graphic);
...
});
You can use the Edit module to do this assuming you are using v3.XX API
Edit | API Reference | ArcGIS API for JavaScript 3.19
Sample
require([
"esri/toolbars/edit", ...
], function(Edit, ... ) {
var editToolbar = new Edit( ... );
//Use the edit toolbar to edit vertices
editToolbar.activate(Edit.EDIT_VERTICES , evt.graphic);
...
});
erf, I need more something like an event "onDoubleClick" or "onCreated" that allow me to edit it just after fired ...
The Edit module will allow you to edit the graphics nodes.
You turn it on and off when you want.
When the user clicks the graphic just call the activate function
Or on 'graphic-add' just call the activate function
No there's no UI ? Juste to click on the graphic ?
If that's it, I have to pay you a beer !
Here is how I would do it..
Add the graphic
On graphic-add call the Edit activate function and pass in the newly created graphic.
Finally, buy me a beer
Drew
Alright ! It sounds great! Thanx a lot !
So, for the beer, I'm living in Toulouse, France and there, there is a cool pub called the De Danu !
1- Go to the De Danu
2- Send me message
3- Come to me and remerber me the cool trick you gave me with the toolbar
4- Drink the cool beer I have paid you !