1/** 2 * pluginname 3 * 4 * @version 0.01 5 * @author name ([email protected]) 6 * @copyright sitename (http://sitename.com/) 7 * @license The MIT License 8 * @link https://github.com/sitename/pluginname 9 * 10 * yyyy-mm-dd hh:ii 11 */ 12;(function($){ 13 $.fn.gmap = function(options){ 14 // console.log( this ); // => element who fired event. 15 16 // Create some defaults, extending them with any options that were provided. 17 var settings = $.extend( { 18 marker : [], 19 center : null, // n}ÌSÜxox 20 zoom : 10, // gå¦ 21 style : false, // n}ÌOÏÝè 22 close : null, // NbNµ½Æ«Ìgå¦ 23 scale : false, // gåÌLø / ³ø 24 wheel : false, // }EXzC[ÌgåEk¬ 25 show : 'click', // infoWindowÌ\¦Cxg 26 hide : 'mouseover', // infoWindow̶Cxg 27 setCenter : false, // infoWindowo»Én}ÌSðYXÜÉ·éH 28 panTo : false, // infoWindowo»Én}ÌSðYXÜÉ·éH w/ Aj[VH 29 smoothZoom : 80, // infoWindowo»Égå + n}ÌSðYXÜÉ·éH w/ Aj[VH 30 direct : false, // ACRðNbNµ½Æ«ÉN·éH 31 preUrl : '', // hrefÌOª 32 serial : '' // ***_sr.html?shop="" 33 }, options); 34 35 36 37 38 39 return this.each(function(){ 40 $this = $(this); 41 var iwArray = []; 42 43 // the smooth zoom function 44 function smoothZoom (map, max, cnt) { 45 if(cnt >= max) { 46 return; 47 } else{ 48 var z = google.maps.event.addListener(map, 'zoom_changed', function(event){ 49 google.maps.event.removeListener(z); 50 smoothZoom(map, max, cnt + 1); 51 }); 52 setTimeout( function(){map.setZoom(cnt)}, settings.smoothZoom); // 0ms is what I found to work well on my system -- it might not work well on all systems 53 } 54 } 55 56 // infoWindow open. 57 function infoShow (marker, latlng, infoContent ) { 58 var map = marker.getMap(); 59 60 if( settings.setCenter || settings.close ){ 61 map.setCenter(latlng); 62 map.setZoom(settings.close); 63 } 64 if( settings.panTo || settings.smoothZoom ){ 65 map.panTo(latlng); 66 } 67 if( settings.smoothZoom ){ 68 smoothZoom(map, settings.close, map.getZoom()); 69 } 70 71 var infowindow = new google.maps.InfoWindow({ 72 content:infoContent 73 }); 74 iwArray.push(infowindow); // zñÉinfowindowðËÁÞ 75 76 var match = 0; 77 $.each(iwArray, function(i){ 78 if( iwArray[i].content == infoContent ){ 79 match++; 80 } 81 }); 82 if( match <= 1 ){ 83 infowindow.open(map, marker); // infowindowJ 84 } 85 } 86 87 // infoWindow close. 88 function infoHide () { 89 $.each(iwArray, function(i){ 90 iwArray[i].close();// iwArrayÌgðÁ· 91 }) 92 iwArray = []; 93 } 94 95 96 97 var mapId = $this.attr('id'); 98 if( settings.style ){ 99 100 var styleOptions = [ 101 { 102 "stylers":[ 103 {"saturation":-100} 104 ] 105 },{ 106 "elementType": "labels.text.fill", 107 "stylers":[ 108 {"color": "#333333"} 109 ] 110 },{ 111 "featureType": "administrative.locality", 112 "elementType": "labels.text", 113 "stylers":[ 114 {"visibility": "off"} 115 ] 116 },{ 117 "featureType": "landscape", 118 "elementType": "geometry.fill", 119 "stylers":[ 120 {"color": "#f2f2f2"} 121 ] 122 },{ 123 "featureType": "poi", 124 "elementType": "geometry.fill", 125 "stylers":[ 126 {"color": "#ededed"} 127 ] 128 },{ 129 "featureType": "road", 130 "elementType": "geometry.fill", 131 "stylers":[ 132 {"color": "#ffffff"} 133 ] 134 },{ 135 "featureType": "road", 136 "elementType": "geometry.stroke", 137 "stylers":[ 138 {"visibility": "off"} 139 ] 140 },{ 141 "featureType":"water", //CEì 142 "elementType":"geometry.fill", 143 "stylers":[ 144 {"color":"#c8d7d4"} 145 ] 146 },{ 147 "featureType":"water", //CEì 148 "elementType":"labels.text.fill", 149 "stylers":[ 150 {"color":"#333333"} 151 ] 152 } 153 ]; 154 155 156 } else{ 157 var styleOptions = []; 158 } 159 160 var mapOptions = { 161 zoom : settings.zoom, 162 center : new google.maps.LatLng( settings.center[0], settings.center[1] ), 163 mapTypeId : google.maps.MapTypeId.ROADMAP, 164 scaleControl : settings.scale, 165 scrollwheel : settings.wheel, 166 styles : styleOptions 167 }; 168 169 170 var mapObj = new google.maps.Map( document.getElementById( mapId ), mapOptions ); 171 if( settings.center ){ 172 mapObj.setCenter( new google.maps.LatLng( settings.center[0], settings.center[1] ) ); 173 } else{ 174 mapObj.setCenter( new google.maps.LatLng( settings.marker['01'].lat, settings.marker['01'].lng ) ); 175 } 176 177 178 $.each(settings.marker, function(i){ 179 180 var latlng = new google.maps.LatLng(settings.marker[i]['lat'], settings.marker[i]['lng']); 181 if( settings.marker[i].marker ){ 182 var iconImg = settings.marker[i].marker, 183 iconSize = new google.maps.Size( settings.marker[i].mkrSz[0], settings.marker[i].mkrSz[1] ), 184 iconPosition = new google.maps.Point( settings.marker[i].mkrPos[0], settings.marker[i].mkrPos[1] ), 185 iconOffset = new google.maps.Point( settings.marker[i].mkrOf[0], settings.marker[i].mkrOf[1] ); 186 187 var marker = new google.maps.Marker({ 188 icon: new google.maps.MarkerImage( iconImg, iconSize, iconPosition, iconOffset, iconSize), 189 position: latlng, 190 map: mapObj 191 }); 192 } else{ 193 var marker = new google.maps.Marker({ 194 position: latlng, 195 map: mapObj 196 }); 197 } 198 var linkUrl = ( settings.marker[i]['url'] == "" ) 199 ?'sr'+ settings.marker[i]['shop_cd'] +'.html' 200 : settings.marker[i]['url']+'" target="_blank' ; 201
202 var linkSrc = ( settings.marker[i]['link'] == true ) 203 ?'<dd class="gmapOpen_shopUrl"><a class="gmapOpen_shopLink" href="' + linkUrl + '" >'+ '<span class="gmapOpen_linkText">ڵͱ¿ç</span>'+ '</a></dd>' 204 :""; 205 206 if( settings.marker[i]['shop_type'] == 'sr' ){ 207 var shopType = 'VÔ'; 208 }@else if( settings.marker[i]['shop_type'] == 'at' ){ 209 var shopType = 'ÃÔ'; 210 }@else if( settings.marker[i]['shop_type'] == 'co' ){ 211 var shopType = '{Ð'; 212 }@else if( settings.marker[i]['shop_type'] == 'rl' ){ 213 var shopType = '^J['; 214 }@else if( settings.marker[i]['shop_type'] == 'bp' ){ 215 var shopType = 'ÂàhHê'; 216 } 217 218 219 var infoContent = 220 '<div class="gmapOpen_InfoWindow">' 221 + '<dl class="gmapOpen_wrapContent">' 222 + '<dt class="gmapOpen_shopTitle">' 223 + '<div class="gmapOpen_shopType">' + shopType +'</div>' 224 + '<div class="gmapOpen_shopName">' + settings.marker[i]['shop_name'] +'</div>' 225 + '</dt>' 226 + '<dd class="gmapOpen_shopLocation">' 227 + '<span class="gmapOpen_shopAddress"><span class="gmapOpen_shopZip">§' + settings.marker[i]['zip'] + '</span>' + settings.marker[i]['address'] + '</span>' 228 + '</dd>' 229 + '<dd class="gmapOpen_shopContact">' 230 + '<span class="gmapOpen_telTitle">TEL</span>' 231 + '<span class="gmapOpen_shopTel">' + settings.marker[i]['tel'] + '</span>' 232 + '</dd>' 233 + linkSrc 234 + '</dl>' 235 '</div>'; 236 237 238 239 if( settings.close && !settings.direct ){ 240 if( settings.show == settings.hide ){ 241 google.maps.event.addListener(marker, settings.show, function(e){ 242 infoHide(); 243 infoShow(marker, latlng, infoContent); 244 }); 245 } else{ 246 google.maps.event.addListener(marker, settings.show, function(e){ 247 infoShow(marker, latlng, infoContent); 248 }); 249 if( settings.hide ){ 250 google.maps.event.addListener(marker, settings.hide, function(e){ 251 infoHide(); 252 }); 253 } 254 } 255 } else if( settings.direct ){ 256 google.maps.event.addListener(marker, 'click', function(e){ 257 location.href = '/home/' + settings.serial + '_sr.html?shop=' + settings.marker[i]['shop_cd']; 258 }); 259 } 260 }); 261 262/* 263 $this.fadeOut(400, function(){ 264 $this.hide(); // => "this = DOM". it must be surrounded by '$'. 265 }); 266*/ 267 268 }); // return for 'Method Chain' end. 269 }; // end gmap. 270})(jQuery);
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.