ArcGIS API for JavaScript is using ESRI Toolbar Widget to handle Drawing like Point 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?
1 Answer 1
Yes.
In the Demo page, add this few lines after map.on("load", createToolbar):
map.on("click", addGraphic);
function addGraphic(evt) {
var symbol = new SimpleMarkerSymbol();
var graphic = new Graphic(evt.mapPoint, symbol);
map.graphics.add(graphic);
alert("Graphic added without the draw toolbar");
}
answered Jan 17, 2017 at 8:30
-
Thanks a lot Lele3p, can we also use same mechanism and other Geometry like line , Polyline, Polygon,.. ?user1760110– user17601102017年01月17日 18:00:42 +00:00Commented Jan 17, 2017 at 18:00
lang-js