AnsweredAssumed Answered

ArcGIS for JavaScript - Click event issues in IE 10 and 11

Question asked by funkeke on Jul 28, 2015
Latest reply on Sep 5, 2017 by lichen122

I am using ArcGIS for JavaScript v. 3.13. I am having two issues with click events in Internet Explorer 10 and 11 only (works great in Chrome).

 

The first issue is that on the "dbl-click" event, e.graphic is always undefined when I click a graphic. However on the "mouse-down" event, e.graphic is present as expected. I define the events in normal dojo style:

 

map.on("dbl-down", function (e) {

    //e.graphic === undefined when graphic is clicked

});

map.on("mouse-down", function (e) {

    //e.graphic !== undefined when graphic is clicked

});

 

The second issue is that click events like "dbl-click" and "mouse-down" cease to fire for the polygon currently being edited after I have switched the edit mode from EDIT_VERTICES to MOVE. The events do fire for other parts of the map or other graphics. My goal is to toggle between edit modes by double-clicking the graphic being edited. This works beautifully in Chrome. Here is my code:

   

//Fires first time, does not fire for same graphic after edit mode is changed

map.on("dbl-click", function (e) {

     if (editingEnabled) {

          var state = editToolBar.getCurrentState();

          var editingGraphic = state.graphic;

 

          if (editingGraphic != null) {

               

               if (editingGraphic.geometry.type === "polygon"

                   && editingGraphic.geometry.contains(e.mapPoint)) {

 

                    if (state.tool == Edit.EDIT_VERTICES) {

                         editToolBar.activate(Edit.MOVE, editingGraphic);

                    } else if (state.tool == Edit.MOVE) {

                         editToolBar.activate(Edit.EDIT_VERTICES, editingGraphic);

                    }

               }

          }

     }

});

 

//Don't zoom if double-clicking a graphic while editing

map.on("mouse-down", function (e) {

     if (e.graphic !== undefined && editingEnabled) {

          map.disableDoubleClickZoom();

     } else {

          map.enableDoubleClickZoom();

     }

});

I would like to know if I am overlooking something or this is a bug with ArcGIS for JavaScript. I only noticed the issues in IE 10 and 11.

Outcomes