function initMap() { var map = new google.maps.Map(document.getElementById('map'), { zoom: , mapTypeControl: false, fullscreenControl: false, streetViewControl: false, rotateControl: false, scaleControl: false, zoomControl: true, center: { lat: , lng: } }); var infoWin = new google.maps.InfoWindow(); // Add some markers to the map. // Note: The code uses the JavaScript Array.prototype.map() method to // create an array of markers based on a given "locations" array. // The map() method here has nothing to do with the Google Maps API. var markers = locs.map(function(location, i) { var marker = new google.maps.Marker({ position: location }); google.maps.event.addListener(marker, 'click', function(evt) { var contenido = (''+locs[i]['usr']+''+'
'+locs[i]['ins']+' - '+locs[i]['sty']+'
'); infoWin.setContent(contenido); infoWin.open(map, marker); }) return marker; }); // Add a marker clusterer to manage the markers. var markerCluster = new MarkerClusterer(map, markers, { imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m' }); // event to close the infoWindow with a click on the map google.maps.event.addListener(map, 'click', function() { infoWin.close(); }); } google.maps.event.addDomListener(window, "load", initMap);