Версия для перчати
',55.754988, 37.695483], ]; var iconURLPrefix = '/images/points/'; var icons = [ iconURLPrefix + 'magaz.png', ] var iconsLength = icons.length; var map = new google.maps.Map(document.getElementById('map'), { zoom: 17, center: new google.maps.LatLng(55.754988, 37.695483), mapTypeId: google.maps.MapTypeId.ROADMAP, scrollwheel: false, mapTypeControl: false, streetViewControl: false, panControl: false, zoomControl: true, zoomControlOptions: { position: google.maps.ControlPosition.LEFT_TOP }, styles: [{}] }); var infowindow = new google.maps.InfoWindow({ maxWidth: 560 }); var markers = new Array(); var iconCounter = 0; for (var i = 0; i < locations.length; i++) { var marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map, icon: icons[iconCounter] }); markers.push(marker); google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infowindow.setContent(locations[i][0]); infowindow.open(map, marker); } })(marker, i)); iconCounter++; if(iconCounter >= iconsLength) { iconCounter = 0; } } function autoCenter() { // Create a new viewpoint bound var bounds = new google.maps.LatLngBounds(); // Go through each... for (var i = 0; i < markers.length; i++) { bounds.extend(markers[i].position); } // Fit these bounds to the map } });