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?

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.