1/** 2 * Create a custom marker icon for the map 3 */ 4function _createIcon(width, height, anchorX, anchorY, image, transparent) { 5 var icon = {}; 6 icon.url = image; 7 icon.size = new google.maps.Size(width, height); 8 icon.anchor = new google.maps.Point(anchorX, anchorY); 9 //icon.shadow = transparent; 10 return icon; 11} 12 13/** 14 * Create a marker for the map 15 */ 16function _createMarker(latlng, icon, title, link) { 17 var tooltip; 18 19 var markerOptions = new google.maps.MarkerOptions(); 20 markerOptions.icon = icon; 21 markerOptions.position = latlng; 22 markerOptions.title = title; 23 24 var marker = new google.maps.Marker(markerOptions); 25 26 // Create a custom tooltip 27 if (title) { 28 tooltip = new Tooltip(marker, title) 29 } 30 31 marker.tooltip = tooltip; 32 marker.link = link; 33 34 if (tooltip) { 35 google.maps.event.addListener(marker, 'mouseover', _markerOverHandler); 36 google.maps.event.addListener(marker, 'mouseout', _markerOutHandler); 37 } 38 if (link) { 39 google.maps.event.addListener(marker, 'click', _markerClickHandler); 40 } 41 42 marker.setMap(map); 43 bounds.extend(marker.getPosition()); 44 return marker; 45} 46 47/** 48 * Create a marker for the map 49 */ 50function _createMarker2(map, latlng, icon, title, link) { 51 var tooltip; 52 53 var markerOptions = new google.maps.MarkerOptions(); 54 markerOptions.icon = icon; 55 markerOptions.position = latlng; 56 markerOptions.title = title; 57 58 var marker = new google.maps.Marker(markerOptions); 59 60 // Create a custom tooltip 61 if (title) { 62 tooltip = new Tooltip(marker, title) 63 } 64 65 marker.tooltip = tooltip; 66 marker.link = link; 67 68 if (tooltip) { 69 google.maps.event.addListener(marker, 'mouseover', _markerOverHandler); 70 google.maps.event.addListener(marker, 'mouseout', _markerOutHandler); 71 } 72 if (link) { 73 google.maps.event.addListener(marker, 'click', _markerClickHandler); 74 } 75 76 marker.setMap(map); 77 return marker; 78} 79 80/** 81 * Create the polygonal lines between markers 82 */ 83function _createPolyline(coords, color, thickness, alpha) { 84 var polyOptions = { 85 clickable : true, 86 geodesic : true, 87 strokeColor : color, 88 strokeWeight : thickness, 89 strokeOpacity : alpha, 90 path : coords 91 }; 92 var polyline = new google.maps.Polyline(polyOptions); 93 return polyline; 94} 95 96 97 98/** 99 * Handles the roll over event for a marker 100 */ 101function _markerOverHandler() { 102 // Check API 103 if (!(this.isInfoWindowOpen) && !(this.isHidden())) { 104 this.tooltip.show(); 105 } 106} 107 108/** 109 * Handles the roll out event for a marker 110 */ 111function _markerOutHandler() { 112 this.tooltip.hide(); 113} 114 115/** 116 * Handles the click event for a marker 117 */ 118function _markerClickHandler() { 119 window.location.href= this.link; 120}
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.