0

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?

asked Jan 16, 2017 at 22:55

1 Answer 1

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
1
  • Thanks a lot Lele3p, can we also use same mechanism and other Geometry like line , Polyline, Polygon,.. ? Commented Jan 17, 2017 at 18:00

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.