` }); } // assuming you also want to hide the infowindow when user mouses-out /*marker.addListener('mouseout', function() { this['infowindow'].close(); });*/ function closeInfoWindows() { if (closeLastWindows != null) { closeLastWindows.close(); } } var typeOfListener = 'mouseover'; // by default for desktop google.maps.event.addListener(marker, typeOfListener, function () { closeInfoWindows(); closeLastWindows = this['infowindow']; this['infowindow'].open(map, this); }); marker.setMap(map); }); //fit the map bounds after loading all markers var bounds = new google.maps.LatLngBounds(); for (i = 0; i < markersArray.length; i++) { bounds.extend(markersArray[i]); } //fit the map bounds after gettin all the markers positions map.fitBounds(bounds); } //check if a map has been loaded if ($('#map-canvas').length > 0) { var cssHideLogo = ""; $('body').append(cssHideLogo); } else { var cssHideLogo = ""; $('body').append(cssHideLogo); } setTimeout(function () { google.maps.event.trigger(map, "resize"); map.fitBounds(bounds); }, 100); // convert the map into big modal $(".compressMap i, .expandMap").click(function () { $(".compressMap, .expandMap").toggleClass("hide"); $("#map-canvas").toggleClass("fullscreen"); google.maps.event.trigger(map, "resize"); map.fitBounds(bounds); }); }); function showPhone(elemente) { $(elemente).addClass("hide").siblings().removeClass("hide"); }