I am developing an app that should also work on mobile devices. I would like to close all open popups when clicking on the map (in this case only one can be open at any point, as opening a new one closes all existing ones; therefore referring to index 0 in the code snippet below).
The event has been registered like this:
itemsMap.events.register("click", itemsMap , function(e){
closeOpenPopups();
});
And here is the function that takes care of it:
function closeOpenPopups(){
// close popup if existent
if(itemsMap.popups[0]){itemsMap.removePopup(itemsMap.popups[0]);}
// unselect all features
control_select_feature_showItem.unselectAll();
}
This works perfectly fine when testing it on non-mobile devices, but the popup just won't close on mobile devices. The strange thing: the unselectAll() works fine, so I guess I can assume that the click event is changed into a tapping event when using a mobile device (or that method would never be fired, right?).