I'm working on optimizing an existing application for mobile devices (iPad, Tablet, Note) and trying to work out how the events are triggered.
The desktop app has hover and click events, on the mobile devices a tap triggers the hover event, how do I trigger the click event?
Kyle,
shouldn't it work just like using it on desktop?
i.e. map.on("click", dosomething);
here is an example: Simple map for iOS | ArcGIS API for JavaScript
Tim
You would think so...
I have different graphics layers, one layer has the hover, when hovered details are displayed in a table and the graphic is added to another layer which is registered to the click event. It works perfectly in all desktop browsers.
looks like this:
graphicLayer1.on("hover", function(evt){
graphicLayer2.add(evt.graphic);
graphicLayer2.on("click", function(evt){
doSomething(); // Never fires on a mobile device
}
}
I may need to rework the flow, this was originally written with api 1.6.
Well, 'click' will work, dbl-click/dbl tap not so much. There's a thread discussing some click/tap issues here that are stil present in the current issue of the api. There's a hacky way to do it, but so far it's an "all hack" or nothing solution as it will break some other click events.