Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

According to Will mousedown events fire with Touch events on OpenLayers mobile?, openlayers 2.11 supports click-like behaviour for vector layers only.

Separate from that, regular pinching/zooming/panning works on the whole map. Weird thing, though, is that zooming on the ipad triggers a click event...

My problem: I don't have a vector layer, but I do want to handle click events on an ipad. I tried attaching 'touchstart' in addition to 'click' to my existing click handler, but that doesn't give any reaction.

So my question is: can I have an OpenLayers.Handler.Click handler on the whole map that reacts to touch taps?

Update: click events work anyway, see below.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

It turns out that the click event works just fine on an ipad anyway. Provided you add the click handler after setting the extent. I don't know why, but that little change made my code work...

Hurray for my colleague that found it out :-)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.