I'm using Gmaps v3 on a website that performs some functions on the map's click and rightclick events. In the web browser on the computer everything works without problems. Already if I use the browser (whatever it is) from a smartphone these listeners do not work, how can I intercept the click and rightclick events in a browser used in the smartphone?
map.addListener('rightclick', function(event) {
var clicked = {lat: event.latLng.lat(), lng: event.latLng.lng()};
infoWindowOptionsMapa.setPosition(clicked);
infoWindowOptionsMapa.open(map);
infoWindows.push(infoWindowOptionsMapa);
sessionStorage.removeItem('clicked');
sessionStorage.setItem('clicked',JSON.stringify(clicked));
});
google.maps.event.addListener(map,'click',function(e) {
closeAllInfoWindows();
checkClass();
});
I researched a bit more and tested the code below, but Chrome does not work.
google.maps.event.addListener(map,'mousedown',function(e) {
var clicked = {lat: e.latLng.lat(), lng: e.latLng.lng()};
alert(clicked);
});