I am building an application using Angular JS, and have been accessing ESRI classes thus far in the following way:
var graphicsLayer = new esri.layers.GraphicsLayer();
I have access to the 'esri' object throughout my application. I am getting this access through my index.html file:
<script src="https://js.arcgis.com/3.12"></script>
Of note, I am not using any dojo code to initialize the map. Is there any way I can access the Draw toolbar class in the ESRI JS API without having to load it in through dojo?
-
esri.bundle.toolbars.drawErikk Ross– Erikk Ross2015年04月07日 17:52:18 +00:00Commented Apr 7, 2015 at 17:52
1 Answer 1
You should be be able to use it like you have used GraphicLayer.
var drawToolBar = new esri.toolbars.Draw(map, options);
Create Buttons using any framework or html, and onclick activate the required tool in draw. couple of things you need to handle is the draw-end to get the geometry from the draw tools. and ensure the map navigation is set to appropriate value when ever draw tool is active or disabled, as show in this example. https://developers.arcgis.com/javascript/jssamples/toolbar_draw.html