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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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