Select to view content in your preferred language

ArcGIS JavaScript API - Draw without Using API Toolbar Widget

1584
3
01-16-2017 10:06 PM
BruceGreen
Occasional Contributor

ArcGIS API for JavaScript is using ESRI Toolbar Widget to handle Drawing Geometry(graphics) on the maps. Here is the Demo doing this job.

Now my question is, is there a way to not use the "esri/toolbars/draw" facilities (Widget) and draw on the Graphic Layer by using core API coding?

0 Kudos
3 Replies
FC_Basson
MVP Regular Contributor

Do you really want to go down that rabbit hole?  I'm sure it is possible by using standard map click event handlers, but you would need to recreate all the graphic feature management tools, not even to mention if you want to edit the features you have drawn.  I would just use the toolbar and try to customize it.  What is the issue with the toolbar? 

0 Kudos
BruceGreen
Occasional Contributor

Thanks for reply FC Basson but what if I want to have my own toolbar? or enabling some more functions like getting x and y of added point or enabling edits and replacing points on the map! the current API is so silence about this things and I was thinking to create a new function to cover all of this!

0 Kudos
FC_Basson
MVP Regular Contributor

Hi Bruce.  When you say "current API" I assume you are actually talking about 3.19 and not 4.2, seeing that Editing and Sketching is not yet part of 4.2 (Choose between version 3.19 and 4.2 | ArcGIS API for JavaScript 4.2 )?  

The 3.19 Draw toolbar (Draw | API Reference | ArcGIS API for JavaScript 3.19 ) can be customized with some additional coding and the Edit toolbar (Edit | API Reference | ArcGIS API for JavaScript 3.19 ) has all the bells and whistles to modify your features.  What more do you need?