Having trouble with Java script even though everything seems to be working fine. I am unable to run the code that follows, specifically the Google function which is crucial. Is there a way to remove this error or find another solution?
//Error occurs on this line
google.maps.event.addDomListener(window, 'load', initGoogleMap);
//Due to the error, this code does not execute properly
google.maps.event.addListener(marker, 'click', function() {
if(!marker.open){
infoWindow.open(map,marker);
marker.open = true;
}
else{
infoWindow.close();
marker.open = false;
}
google.maps.event.addListener(map, 'click', function() {
infoWindow.close();
marker.open = false;
});
});