May I know how can I disable double click on google map so that the info window will not close when I double click on google map? Can it be done through google map api?
(Please consider that this is not answer, it is only same solution like Ravindranath Akila has been answering already, for using in wider ranges of solutions [eg. Mobile platforms] concentrated on one reusable method without global variables)
We have similar trouble by Win 8.1 Mobile app. Thanks to Ravindranath Akila we finalized solution which is defined in one method and checking also zooming and moving with center of map. Anyway sometimes happened that the address we get from map-click is wrong - improvements are welcomed.
// code
{
// adding event method
addGoogleClickEnventHandler(map, function(e) {
// example code inside click event
var clickLocation = e.latLng;
getAddress(clickLocation);
});
}
// function
function addGoogleClickEnventHandler(googleEventableObject, handlingFunction) {
var boundsChanged = false;
var centerChanged = false;
var singleClick = false;
function runIfNotDblClick(obj) {
if(singleClick && !boundsChanged && !centerChanged){
handlingFunction(obj);
}
};
googleEventableObject.addListener('bounds_changed', function () { boundsChanged = true; });
googleEventableObject.addListener('center_changed', function () { centerChanged = true; });
googleEventableObject.addListener('dblclick', function () { singleClick = false; });
googleEventableObject.addListener('click', function(obj) {
singleClick = true;
setTimeout(function() {
runIfNotDblClick(obj);
}, 200);
boundsChanged = false;
centerChanged = false;
});
}