Mobile Feature Layer Click Event

1132
2
Jump to solution
02-28-2017 07:09 AM
bmanghi
New Contributor III

I'm trying to customize the map series template by changing the content of the infoTemplate for a feature layer, but I'm having trouble with the click event listener.  I've added the listener to the feature layer after the webmap is loaded and it works fine on a desktop browser, but I get nothing on a mobile device (iPad).  I thought maybe it was related to a mobile infoWindow or Popup, but I've tried debugging the iPad and it looks like the event listener isn't responding.  Any insights or advice?  Any help is greatly appreciated.  

0 Kudos
1 Solution

Accepted Solutions
StephenSylvia
Esri Regular Contributor

Does it respond it you double click on it? Sometime touch devices will count a click or tap as a mouseover or hover event. This usually happens if the CSS has a hover selector or their is also a mouseover event for desktop that has not been disabled. You could look into using a gesture library for better event recognition on touch devices. This one might be easy to include since you already have access to the dojo library: dojox.gesture — The Dojo Toolkit - Reference Guide.

View solution in original post

0 Kudos
2 Replies
StephenSylvia
Esri Regular Contributor

Does it respond it you double click on it? Sometime touch devices will count a click or tap as a mouseover or hover event. This usually happens if the CSS has a hover selector or their is also a mouseover event for desktop that has not been disabled. You could look into using a gesture library for better event recognition on touch devices. This one might be easy to include since you already have access to the dojo library: dojox.gesture — The Dojo Toolkit - Reference Guide.

0 Kudos
bmanghi
New Contributor III

Doesn't respond on a double click, but I was able to attach the listener to the map and now it's working.  Thanks for your response and I'll have to keep your suggestion in mind for future projects.

0 Kudos