1function initialize_map(divForMap, points) { 2 var map, infowindow, markers = [], 3 isDraggable = is_desktop ? true : false, 4 isWheel = false, 5 bounds = new google.maps.LatLngBounds(); 6 7 8 var i, point, myOptions = { 9 mapTypeId: google.maps.MapTypeId['ROADMAP'], 10 zoom: map_zoom, 11 center: new google.maps.LatLng(points[0].lat, points[0].lng), 12 draggable: isDraggable, 13 scrollwheel: isWheel, 14 panControl: false, 15 mapTypeControlOptions: { 16 position: google.maps.ControlPosition.RIGHT_BOTTOM 17 }, 18 fullscreenControl: false, 19 streetViewControlOptions: { 20 position: google.maps.ControlPosition.RIGHT_TOP 21 }, 22 zoomControlOptions: { 23 style: google.maps.ZoomControlStyle.SMALL, 24 position: google.maps.ControlPosition.RIGHT_CENTER 25 }, 26 }; 27 28 map = new google.maps.Map(document.getElementById(divForMap), myOptions); 29 window.map = map; 30 for (i = 0; i < points.length; i++) { 31 if (typeof currentPoint !== 'undefined' && currentPoint != i && i != poiformarkers.length - 1) continue; 32 33 point = points[i]; 34 markers[i] = new google.maps.Marker({ 35 position: new google.maps.LatLng(point.lat, point.lng), 36 map: map, 37 title: point.title, 38 icon: point.marker, 39 marker_popup_class: point.marker_popup_class 40 }); 41 42 43 google.maps.event.addListener(markers[i], 'click', (function (i) { 44 var marker = markers[i], point = points[i]; 45 46 return function () { 47 if (typeof point.image !== "undefined") { 48 var marker_image = '<div class="thumb" style="background-image: url(\'img/' + point.image + '\')"></div>'; 49 } else { 50 marker_image = ''; 51 } 52 var contentString = '<div class="info_window"><div class="wrap"><div class="contacts"><div class="title">' + point.title + '</div><span class="address">' + point.address + '</span> <span class="phone"> ' + point.phone + '</span><span class="mail"> ' + point.mail + '</span></div></div></div>'; 53 if (typeof infowindow !== 'undefined') infowindow.close(); 54 infowindow = new google.maps.InfoWindow({content: contentString}); 55 window.map.setCenter(new google.maps.LatLng(point.lat, point.lng)); 56 infowindow.open(map, marker); 57 }; 58 59 })(i)); 60 61 bounds.extend(new google.maps.LatLng(point.lat, point.lng)); 62 } 63 64 if (points.length > 1) { 65 changeZoom(); 66 map.fitBounds(bounds); 67 } else { 68 map.setCenter(new google.maps.LatLng(hotel_gps_coordinates.latitude, hotel_gps_coordinates.longitude)); 69 directionsService = new google.maps.DirectionsService(), directionsDisplay = new google.maps.DirectionsRenderer({suppressMarkers: false, markerOptions: {zIndex: 10}}); 70 } 71 var default_styles = [{"featureType": "poi.business","elementType": "all","stylers": [{"visibility": "off"}]}]; 72 var styles = [{"stylers": [{"saturation": -100}]},{"featureType": "poi.business","stylers": [{"visibility": "off"}]}]; 73 map.setOptions({styles: styles}); 74 75 google.maps.event.addDomListener(window, "resize", function () { 76 google.maps.event.trigger(map, "resize"); 77 if (points.length > 1) { 78 map.fitBounds(bounds); 79 } else { 80 map.setCenter(new google.maps.LatLng(hotel_gps_coordinates.latitude, hotel_gps_coordinates.longitude)); 81 } 82 }); 83 84 function changeZoom() { 85 google.maps.event.addListenerOnce(map, 'bounds_changed', function (event) { 86 // if (!is_mobile) { 87 //if ($('html').hasClass('index')) { 88 var currentZoom = this.getZoom(), 89 newZoom = currentZoom - 1; 90 if (newZoom != 0) { 91 this.setZoom(newZoom); 92 } 93 // } 94 // } 95 }); 96 }; 97}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.