AnsweredAssumed Answered

How to delete a polygon?

Question asked by barlesj on Aug 25, 2013
Latest reply on Aug 25, 2013 by JGravois-esristaff
Hi,

I have this code so far and it is able to execute the alert("hello"), but never gets into the function for applyEdits to delete a polygon. What am I doing wrong?

   dojo.connect(map.graphics, "onClick", function(evt) {   
     dojo.stopEvent(evt); 

       if (evt.ctrlKey === true) {  //delete feature if ctrl key is depressed
        alert("hello");
         map.graphics.applyEdits(null, null, [evt.graphic], function() {
          alert("delete");
            var operation = new esri.dijit.editing.Delete({
              featureLayer: map.graphics,
              deletedGraphics: [evt.graphic]
            });      
         });
        }
       
    });

Outcomes