Solved! Go to Solution.
// get the map id, coincides with DOM element id. var nodeId = this.map.id; // get the graphics container node, it looks like "map-id_gc" var node = dom.byId(nodeId+'_gc'); // listen for doubletap on the graphics container of svg graphics on(node, tap.doubletap, lang.hitch(this, function(e) { // I keep an array of layers to search through, but you could just // work off a single layer arrayUtils.forEach(layersArray, function(lyr) { var i = lyr.graphics.length; while(i--) { // get a graphic var graphic = lyr.graphics; // get the node of the graphic var gnode = graphic.getNode(); // if the node and the doubletap target are a match // do what you want to do if (gnode === e.target) { e.graphic = graphic; // I pass this on to my original double-click // handler and just add the graphic to the event // pretty much a duplicate of the dbl-click event this.onLayerDblClick(e); } } }, this); }) );
// get the map id, coincides with DOM element id. var nodeId = this.map.id; // get the graphics container node, it looks like "map-id_gc" var node = dom.byId(nodeId+'_gc'); // listen for doubletap on the graphics container of svg graphics on(node, tap.doubletap, lang.hitch(this, function(e) { // I keep an array of layers to search through, but you could just // work off a single layer arrayUtils.forEach(layersArray, function(lyr) { var i = lyr.graphics.length; while(i--) { // get a graphic var graphic = lyr.graphics; // get the node of the graphic var gnode = graphic.getNode(); // if the node and the doubletap target are a match // do what you want to do if (gnode === e.target) { e.graphic = graphic; // I pass this on to my original double-click // handler and just add the graphic to the event // pretty much a duplicate of the dbl-click event this.onLayerDblClick(e); } } }, this); }) );
I'm curious if getting double-tap to work in an upcoming version of the API is on the roadmap anywhere. Mobile editing is pretty key and although the hack I posted still works, I am finding it can interfere with some other click events on the map. I am still trying to work around this issue in my particular case, so it may work fine for others. It would however be nice if the API could check for touch events and fallback to those as needed behind the scenes.
By the way, I have created a widget that implements the above hack.
it didnt work for me b/c of the click event conflicts. Jonathan Uihlein indicated it is on the roadmap, but I am not sure where.
It is desperately need.