1$debug=0; 2$j = jQuery.noConflict(); 3$maps = new Array(); 4 5$j(document).ready(function() { 6 7 $j('.be-google-map').each(function($a, $mapdata) { 8 9 10 $relValues = jQuery.parseJSON($j($mapdata).children('.be-google-map-properties').attr('rel').replace(/'/gi, '"')); 11 $mapPoints = new Array(); 12 $mapCenterX = parseFloat($relValues.centerX); 13 $mapCenterY = parseFloat($relValues.centerY); 14 $mapZoomLevel = parseInt($relValues.zoom); 15 $geocoder = new google.maps.Geocoder(); 16 $boundaries = new google.maps.LatLngBounds(); 17 $boundariesUpdateTimer = 0; 18 19 $j($mapdata).children('.be-google-map-point').each(function($i, $pointdata) { 20 $relValues = jQuery.parseJSON($j($pointdata).children('.be-google-map-point-ll').attr('rel').replace(/'/gi, '"')); 21 $point_lat = $relValues.lat; 22 $point_long = $relValues.long; 23 $point_title = $j($pointdata).children('.be-google-map-point-title').html(); 24 $point_address = $j($pointdata).children('.be-google-map-point-address').html(); 25 $point_description = $j($pointdata).children('.be-google-map-point-description').html(); 26 $icon_size = new google.maps.Size(24,24); 27 $icon_origin = new google.maps.Point(0,0); 28 $icon_anchor = new google.maps.Point(0,32); 29 $point_image = (($i <= 25) ? "/images/tripplanner/"+($i+1)+".gif" : "/images/tripplanner/default.gif"); 30 $point_icon = new google.maps.MarkerImage($point_image,$icon_size,$icon_origin,$icon_anchor); 31 $shadow_size = new google.maps.Size(37,34); 32 $shadow_origin = new google.maps.Point(9,2); 33 $shadow_anchor = new google.maps.Point(18,35); 34 $point_shadow = new google.maps.MarkerImage("http://www.google.com/mapfiles/shadow50.png",$shadow_size,$shadow_origin,$shadow_anchor); 35 $point_shape = { 36 coord: [12,12,12], 37 type: "circle" 38 } 39 $maxPointIndex = $mapPoints.length; 40 $mapPoints[$maxPointIndex] = new Array($point_lat, $point_long, $point_icon, $point_title, '<p style="font-size:16px; margin:0; padding:0"><strong>'+$point_title+'</strong></p><p style="margin:0; padding:6px 0">'+$point_address+'</p><p style="margin:0; padding:6px 0; white-space:nowrap">'+$point_description+'</p>', $point_address, $point_shadow, $point_shape); 41 42 }); 43 myLatLng = new google.maps.LatLng($mapCenterX, $mapCenterY); 44 myOptions = { 45 center: myLatLng, 46 zoom: $mapZoomLevel, 47 mapTypeId: google.maps.MapTypeId.ROADMAP 48 }; 49 $maps[$a] = new google.maps.Map(document.getElementById($j($mapdata).attr('id')),myOptions); 50 $maps[$a].impart_zoomlevel = $mapZoomLevel; 51 $maps[$a].impart_centerpos = myLatLng; 52 for (var $i=0; $i<$mapPoints.length; $i++) { 53 if (($mapPoints[$i][0] == '0') && ($mapPoints[$i][1] == '0')) { 54 if ($geocoder && $mapPoints[$i][5] != "") { 55 56 function addPointFromAddress($mapPoint, $a) { 57 58 $geocoder.geocode({ "address": $mapPoint[5] }, function (results, status) { 59 60 if (status == google.maps.GeocoderStatus.OK) { 61 //myLatLng = results[0].geometry.location; 62 $mapPoint[0] = String(results[0].geometry.location.ob); 63 $mapPoint[1] = String(results[0].geometry.location.pb); 64 65 if ($mapPoint[0] == 'undefined') $mapPoint[0] = String(results[0].geometry.location.d); 66 if ($mapPoint[1] == 'undefined') $mapPoint[1] = String(results[0].geometry.location.e); 67 68 // save the map point details back to the global map point 69 //if ($mapPoint[0] != undefined && $mapPoint[1] != undefined ) $mapPoints[$i] = new Array(); 70 //if ($mapPoint[0] != undefined) $mapPoints[$i][0] = $mapPoint[0]; 71 //if ($mapPoint[1] != undefined) $mapPoints[$i][1] = $mapPoint[1]; 72 73 var marker = createMarker($mapPoint, $a); 74 75 } 76 }); 77 } 78 addPointFromAddress($mapPoints[$i], $a); 79 80 81 82 } 83 } else { 84 85 var marker = createMarker($mapPoints[$i], $a); 86 87 } 88 89 90 //$boundariesUpdateTimer = setTimeout(function() { updateZoomAndCenter($a, $boundaries); }, 1000); 91 } 92 }); 93 94}); 95 96function updateZoomAndCenter($a, $boundaries) { 97 98 $maps[$a].fitBounds($boundaries); 99 if ($maps[$a].getZoom() > 14) { 100 $maps[$a].setZoom(14); 101 102 } 103 104 105 106} 107 108function redrawMap($a) { 109 /* 110 $maps[$a].checkResize(); 111 $maps[$a].setZoom($maps[$a].impart_zoomlevel); 112 $maps[$a].setCenter($maps[$a].impart_centerpos); 113 */ 114} 115 116function createMarker($mapPoint, $a) { 117 118 119 var myLatLng = new google.maps.LatLng($mapPoint[0], $mapPoint[1]); 120 121 var locationMarker = new google.maps.Marker({ 122 position: myLatLng, 123 map: $maps[$a], 124 shadow: $mapPoint[6], 125 icon: $mapPoint[2], 126 title: $mapPoint[3], 127 shape: $mapPoint[7] 128 }); 129 130 131 132 var infowindow = new google.maps.InfoWindow({ 133 content: $mapPoint[4] 134 }); 135 136 $boundaries.extend (myLatLng); 137 138 google.maps.event.addListener(locationMarker, 'click', function() { 139 infowindow.open($maps[$a],locationMarker); 140 }); 141 142 return locationMarker; 143 144} 145
146document.write('<style type="text/css"> .be-google-map-point { display:none; } .be-google-map { height:300px; } </style>');
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.