1"use strict"; 2 3(function ($, window, undefined) { 4 $.fn.nearby = function (options) { 5 // console.log( this ); 6 // => element who fired event. 7 // Create some defaults, extending them with any options that were provided. 8 var settings = $.extend({ 9 array: null, 10 from: 'gps', 11 min: 4, 12 input: '#js-nearby-search', 13 container_class: 'c-showroom-nearby', 14 button_class: 'c-showroom-nearby__foot', 15 loading_class: 'c-showroom-nearby__loading', 16 item_class: 'c-showroom-nearby-item', 17 link_prefix: '', 18 view: 'distance' 19 }, options); 20 21 var el = this; 22 23 $('.' + settings.container_class).prepend('<span class="' + settings.loading_class + '">...</span>'); 24 25 return this.each(function () { 26 var points = settings.array; 27 var type = settings.from; 28 29 // »ÝÊuÌæ¾ 30 function dfdCurrentPosition() { 31 var dfd = $.Deferred(); 32 33 // GeolocationªgpÂ\©`FbN 34 if (!window.navigator.geolocation) dfd.reject(); 35 36 // »ÝnÌæ¾ 37 window.navigator.geolocation.getCurrentPosition( // Success 38 function (position) { 39 dfd.resolve(position); 40 }, // Error 41 function (error) { 42 dfd.reject(); 43 }, // Options 44 { 45 enableHighAccuracy: true, 46 //Êuîñ̸xð 47 timeout: 10000, 48 //10bÅ^CAEg 49 maximumAge: 600000 //10ªÔLø 50 51 }); 52 return dfd.promise(); 53 } 54 55 // Zwè 56 function dfdPointPosition() { 57 var dfd = $.Deferred(); 58 59 if (type === 'gps') { 60 // GeolocationªgpÂ\©`FbN 61 if (!window.navigator.geolocation) dfd.reject(); 62 63 // »ÝnÌæ¾ 64 window.navigator.geolocation.getCurrentPosition( // Success 65 function (position) { 66 dfd.resolve(position); 67 }, // Error 68 function (error) { 69 dfd.reject(); 70 }, // Options 71 { 72 enableHighAccuracy: true, 73 //Êuîñ̸xð 74 timeout: 10000, 75 //10bÅ^CAEg 76 maximumAge: 600000 //10ªÔLø 77 78 }); 79 return dfd.promise(); 80 } else if (type === 'address') { 81 // XÖԩǤ©ð»è·ét@NV 82 var isPostcode = function isPostcode(postcode) { 83 if (postcode.match(/^\d{3}-?\d{4}$/)) { 84 return true; 85 } else { 86 return false; 87 } 88 }; 89 90 // wèµ½ZÌÜxoxðæ¾ 91 var place = $(settings.input).val(); 92 93 if (isPostcode(place)) { 94 $.ajax({
95 url: '/common-php/ajax.php?url=https://api.zipaddress.net/?zipcode=' + place, 96 type: "GET", 97 data: { 98 'zipcode': place 99 }, 100 dataType: 'json' 101 }).done(function (data) { 102 var fullAddress = data.data.fullAddress; 103 fullAddress = encodeURI(fullAddress); 104 $.ajax({ 105 url: '/common-php/geocoding/?q=' + fullAddress, 106 type: "GET", 107 dataType: 'xml' 108 }).done(function (xml) { 109 dfd.resolve(xml); 110 }).fail(function (error) { 111 dfd.reject(); 112 }); 113 }).fail(function (error) { 114 dfd.reject(); 115 }); 116 } else { 117 place = encodeURI(place); 118 $.ajax({ 119 url: '/common-php/geocoding/?q=' + place, 120 type: "GET", 121 dataType: 'xml' 122 }).done(function (xml) { 123 dfd.resolve(xml); 124 }).fail(function (error) { 125 dfd.reject(); 126 }); 127 } 128 129 return dfd.promise(); 130 } else {} 131 } 132 133 // f[^ªµÁ½iKÅ\[gðJn 134 $.when(dfdPointPosition()).done(function (position) { 135 var lat, lng; 136 137 // »Ýn 138 if (type === 'gps') { 139 var lat = position.coords.latitude; 140 var lng = position.coords.longitude; 141 } else if (type === 'address') { 142 var lat = $(position).find('lat').text(); 143 var lng = $(position).find('lng').text(); 144 } else { 145 alert('nearby.js : option \'from\' has Invalid value.'); 146 } 147 148 if (lat && lng) { 149 // sortpÌzñðè` 150 var sorted = []; 151 152 // £ÌèoµðsÈ¢Aef[^Édistance®«ðÝè 153 for (var key in points) { 154 var _distance = getDistance(points[key].lat, points[key].lng, lat, lng, 0) / 1000; //kmÅZo 155 156 157 points[key].distance = Math.floor(_distance * 100) / 100; 158 159 // ¬_æ2ÊÜÅÉÀè 160 sorted.push(points[key].distance); 161 } 162 163 // »Ýn©çÌ£ª¬³¢É\[g 164 sorted.sort(function (a, b) { 165 if (a < b) return -1; 166 if (a > b) return 1; 167 return 0; 168 }); 169 sorted.splice(settings.min); 170 171 // f[^ðoÍ 172 el.html(''); 173 174 // £ª¯¶XܪññoͳêĵܤÌÅoÍÏÌ_R[hðÛ¶·é 175 var already = []; 176 var prefSetting = { 177 'osaka': { 178 'id': 'hondacars-osaka', 179 'name': 'Honda Cars åã', 180 'kanban_cd': '1' 181 }, 182 'nara': { 183 'id': 'hondacars-minamikinki-nara', 184 'name': 'Honda Cars ìßEÞÇ', 185 'kanban_cd': '2' 186 }, 187 'wakayama': { 188 'id': 'hondacars-minamikinki-wakayama', 189 'name': 'Honda Cars ìßEaÌR', 190 'kanban_cd': '3' 191 }, 192 'hyogo': { 193 'id': 'hondacars-hyogo', 194 'name': 'Honda Cars ºÉ', 195 'kanban_cd': '4' 196 }, 197 'kyoto': { 198 'id': 'hondacars-kyoto', 199 'name': 'Honda Cars s', 200 'kanban_cd': '5' 201 }, 202 }; 203 204 var appendHtml = ""; 205 206 for (var i = 0; i < settings.min; i++) { 207 for (var key in points) { 208 if (sorted[i] === points[key].distance && already.indexOf(points[key].shop_cd) == -1) { 209 already.push(points[key].shop_cd); 210 var cName = settings.item_class; 211 var shop = points[key]; 212 213 if (shop.shop_type == "ex") { 214 if (["newcar", "move", "other", "footer"].includes(settings.type)) { 215 var contactHtml = ``; 216 } else { 217 var contactHtml = `<div class="${cName}__contact"> 218 <a class="${cName}-button" href="/${prefSetting[shop.pref_name].id}/showroom/sr${shop.shop_cd}.html"> 219 <i><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.65 16.81">
219<path fill="currentColor" fill-rule="evenodd" d="M7.31 10.66a3.28 3.28 0 1 1 3.26-3.28 3.269 3.269 0 0 1-3.26 3.28Zm0-4.92a1.64 1.64 0 1 0 1.63 1.64 1.637 1.637 0 0 0-1.63-1.64Zm0 11.06a2.408 2.408 0 0 1-1.72-.72L2.14 12.6a7.424 7.424 0 0 1 0-10.44 7.279 7.279 0 0 1 10.35 0 7.443 7.443 0 0 1 0 10.44l-3.45 3.48a2.43 2.43 0 0 1-1.73.72Zm0-15.16a5.633 5.633 0 0 0-4.02 1.68 5.77 5.77 0 0 0 0 8.12l3.45 3.48a.809.809 0 0 0 1.15 0l3.45-3.48a5.783 5.783 0 0 0 0-8.12 5.656 5.656 0 0 0-4.03-1.68Zm4.6 10.38Z"/></svg></i> 220 <span>XÜÌÚ×ð©é</span> 221 </a> 222 </div>`; 223 } 224 } else if (settings.type == "newcar") { 225 var contactHtml = ` 226 <div class="${cName}__contact _newcar"> 227 <a class="${cName}-button" href="https://contact.hondanet.co.jp/hondamobility-kinki/form/syodan/jump?contact_type=1&shop_code=${shop.shop_cd}" target="_blank"> 228 <i><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22"><path fill="currentColor" fill-rule="nonzero" d="M2.981 19.03a1.081 1.081 0 0 1-.621-.19 1.1 1.1 0 0 1-.464-1.09l.577-3.45A7.821 7.821 0 0 1 0 8.58a7.9 7.9 0 0 1 2.935-6.14A10.179 10.179 0 0 1 6.257.64a14.418 14.418 0 0 1 8.5 0 10.179 10.179 0 0 1 3.322 1.8 7.89 7.89 0 0 1 0 12.28 10.179 10.179 0 0 1-3.322 1.8 13.8 13.8 0 0 1-4.248.64 14.429 14.429 0 0 1-3.412-.4l-3.549 2.11a1.042 1.042 0 0 1-.567.16ZM10.505 2.2C5.615 2.2 2.2 4.82 2.2 8.58a5.717 5.717 0 0 0 2.159 4.46 1.1 1.1 0 0 1 .385 1.03l-.285 1.7 1.907-1.14a1.072 1.072 0 0 1 .873-.11 11.727 11.727 0 0 0 3.266.44c4.89 0 8.305-2.62 8.305-6.38S15.4 2.2 10.505 2.2ZM19.689 22a1.141 1.141 0 0 1-.592-.17l-2.13-1.36a9.148 9.148 0 0 1-2.123.24 8.026 8.026 0 0 1-4.4-1.21 5.986 5.986 0 0 1-2.475-3.2 1.102 1.102 0 1 1 2.1-.67c.571 1.78 2.4 2.88 4.777 2.88a6.873 6.873 0 0 0 1.972-.28 1.073 1.073 0 0 1 .922.12l.487.31-.06-.38a1.1 1.1 0 0 1 .359-.99 3.75 3.75 0 0 0 1.276-2.84 3.686 3.686 0 0 0-1.105-2.67 1.1 1.1 0 1 1 1.55-1.56 5.987 5.987 0 0 1 .182 8.28l.348 2.23A1.1 1.1 0 0 1 19.689 22Z"/></svg></i> 229 <span>¤k\Ý</span> 230 </a> 231 <a class="${cName}-button" href="https://shopsearch.honda.co.jp/auto/d-contact/input/op_connect/?form_id=0231&app_id=06&keiro_cd=00010&hojin_cd=3353533&kanban_no=${prefSetting[shop.pref_name].kanban_cd}&kyoten_cd=${shop.shop_cd}" target="_blank"> 232 <i><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.719 23.41"><path fill="currentColor" fill-rule="evenodd" d="M12.875 7.02H5.856a1.17 1.17 0 1 1 0-2.34h7.019a1.17 1.17 0 0 1 0 2.34Zm0 11.72a1.176 1.176 0 0 1-1.17-1.18v-3.51a1.17 1.17 0 0 1 2.34 0v3.51a1.176 1.176 0 0 1-1.17 1.18Zm.012-7.03h-.012a1.17 1.17 0 1 1 0-2.34h.012a1.17 1.17 0 0 1 0 2.34Zm-3.51 0h-.012a1.17 1.17 0 0 1 0-2.34h.016a1.17 1.17 0 0 1 0 2.34Zm-3.509 0h-.012a1.17 1.17 0 1 1 0-2.34h.012a1.17 1.17 0 0 1 0 2.34Zm0 3.51h-.012a1.17 1.17 0 1 1 0-2.34h.012a1.17 1.17 0 0 1 0 2.34Zm3.509 0h-.012a1.17 1.17 0 0 1 0-2.34h.016a1.17 1.17 0 0 1 0 2.34Zm0 3.52h-.012a1.175 1.175 0 0 1 0-2.35h.016a1.175 1.175 0 0 1 0 2.35Zm-3.509 0h-.012a1.175 1.175 0 0 1 0-2.35h.012a1.175 1.175 0 0 1 0 2.35Zm7.007 4.68H5.856a20.94 20.94 0 0 1-2.723-.1 3.192 3.192 0 0 1-3.031-3.03 21.945 21.945 0 0 1-.1-2.73V5.85a21.688 21.688 0 0 1 .1-2.72A3.191 3.191 0 0 1 3.133.09 23.251 23.251 0 0 1 5.856 0h7.019a23.279 23.279 0 0 1 2.724.09 3.191 3.191 0 0 1 3.03 3.04 21.688 21.688 0 0 1 .1 2.72v11.71a21.945 21.945 0 0 1-.1 2.73 3.192 3.192 0 0 1-3.03 3.03 20.964 20.964 0 0 1-2.724.1ZM5.856 2.34c-1.762 0-2.825 0-3.167.34s-.343 1.41-.343 3.17v11.71c0 1.77 0 2.83.343 3.17s1.405.35 3.167.35h7.019c1.761 0 2.825 0 3.167-.35s.343-1.4.343-3.17V5.85c0-1.76 0-2.83-.343-3.17s-1.406-.34-3.167-.34H5.856Z"/></svg></i> 233 <span>©ÏË</span> 234 </a> 235 <a class="${cName}-button" href="https://shopsearch.honda.co.jp/auto/d-contact/input/op_connect/?form_id=0241&app_id=06&keiro_cd=00010&hojin_cd=3353533&kanban_no=${prefSetting[shop.pref_name].kanban_cd}&kyoten_cd=${shop.shop_cd}" target="_blank"> 236 <i><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.937 16">
236<path fill="currentColor" fill-rule="evenodd" d="M15.024 15.99a.894.894 0 0 1-.625-.26l-2.993-3.01a7.056 7.056 0 0 1-9.339-.59 7.069 7.069 0 1 1 10.589-.66l2.993 3.01a.882.882 0 0 1 0 1.25.893.893 0 0 1-.625.26ZM7.068 1.78a5.316 5.316 0 0 0-5.3 5.33 5.3 5.3 0 0 0 9.054 3.77 5.352 5.352 0 0 0 0-7.54 5.243 5.243 0 0 0-3.754-1.56Z"/></svg></i> 237 <span>¸è\Ý</span> 238 </a> 239 <a class="${cName}-button" href="https://contact.hondanet.co.jp/hondamobility-kinki/form/syodan/jump?contact_type=2&shop_code=${shop.shop_cd}" target="_blank"> 240 <i><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24.624 22.12"><path fill="currentColor" fill-rule="evenodd" d="M12.312 22.13a1.235 1.235 0 0 1-.379-.06 1.252 1.252 0 0 1-.192-.08.772.772 0 0 1-.13-.08L9.43 20.46a7.648 7.648 0 0 0-.939-.58 2.171 2.171 0 0 0-.553-.17 7.1 7.1 0 0 0-1.1-.04H3.202a3.847 3.847 0 0 1-1.856-.27A2.421 2.421 0 0 1 .27 18.33a3.888 3.888 0 0 1-.269-1.86V3.18A3.845 3.845 0 0 1 .27 1.33 2.443 2.443 0 0 1 1.346.25a3.981 3.981 0 0 1 1.856-.26h1.231c2.951 0 4.432 0 5.749.67a6.167 6.167 0 0 1 2.13 1.78 6.157 6.157 0 0 1 2.13-1.78c1.316-.67 2.8-.67 5.749-.67h1.231a3.985 3.985 0 0 1 1.856.26 2.453 2.453 0 0 1 1.076 1.08 3.858 3.858 0 0 1 .268 1.85v13.29a3.9 3.9 0 0 1-.268 1.86 2.376 2.376 0 0 1-1.076 1.07 3.847 3.847 0 0 1-1.856.27h-3.628a7.075 7.075 0 0 0-1.1.04 2.147 2.147 0 0 0-.553.17 6.8 6.8 0 0 0-.94.58l-2.181 1.45c-.04.03-.08.05-.122.08a7.45 7.45 0 0 1-.211.09 1.152 1.152 0 0 1-.375.05ZM2.476 17.2c.149.01.441.01.725.01h3.628a8.182 8.182 0 0 1 1.535.08 5.3 5.3 0 0 1 1.106.33 8.7 8.7 0 0 1 1.319.79l.291.19V9.09c0-2.56 0-3.84-.4-4.63a3.622 3.622 0 0 0-1.614-1.61c-.79-.4-2.073-.4-4.631-.4H3.202c-.284 0-.576 0-.725.01-.014.15-.014.44-.014.72v13.29c0 .29 0 .58.014.73Zm11.066-8.11v9.51l.291-.19a8.7 8.7 0 0 1 1.319-.79 5.3 5.3 0 0 1 1.106-.33 8.182 8.182 0 0 1 1.535-.08h3.628c.284 0 .576 0 .725-.01.013-.15.013-.44.013-.73V3.18c0-.28 0-.57-.013-.72-.149-.01-.441-.01-.725-.01H20.19c-2.558 0-3.842 0-4.632.4a3.625 3.625 0 0 0-1.613 1.61c-.402.79-.402 2.07-.402 4.63Zm8.677-6.62Zm-19.816 0Z"/></svg></i> 241 <span>J^O¿</span> 242 </a> 243 </div>`; 244 } else if (settings.type == "move") { 245 var contactHtml = ` 246 <div class="${cName}__contact _move"> 247 <a class="${cName}-button" href="https://shopsearch.honda.co.jp/auto/d-contact/input/op_connect/?form_id=0261&app_id=06&keiro_cd=00010&hojin_cd=3353533&kanban_no=${prefSetting[shop.pref_name].kanban_cd}&kyoten_cd=${shop.shop_cd}" target="_blank"> 248 <i><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20.22 21.82"><path fill="currentColor" fill-rule="evenodd" d="M19.26 4.94 11.03.24a1.9 1.9 0 0 0-1.85 0L.95 4.94a1.894 1.894 0 0 0-.94 1.63v8.84a1.878 1.878 0 0 0 .94 1.49l8.23 4.65a1.9 1.9 0 0 0 1.85 0l8.23-4.65a1.854 1.854 0 0 0 .94-1.49v-8.9a1.874 1.874 0 0 0-.94-1.57ZM9.18 19.46l-3.19-1.79V9.74l3.19 1.74v7.98Zm.93-9.6L7 8.16l7.19-3.99 3.12 1.76Zm0-7.99 2.18 1.22-7.24 4.02L2.9 5.93ZM1.88 7.5l2.24 1.23v7.88l-2.24-1.2V7.5Zm9.15 11.96v-7.98l7.3-3.98v7.91Z"/></svg></i> 249 <span>]A</span> 250 </a> 251 </div>`; 252 } else if (settings.type == "other") { 253 var contactHtml = ` 254 <div class="${cName}__contact _other"> 255 <a class="${cName}-button" href="https://shopsearch.honda.co.jp/auto/d-contact/input/op_connect/?form_id=0311&app_id=06&keiro_cd=00010&hojin_cd=3353533&kanban_no=${prefSetting[shop.pref_name].kanban_cd}&kyoten_cd=${shop.shop_cd}" target="_blank"> 256 <i><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25"><path fill="currentColor" fill-rule="evenodd" d="M7.318 11.29a1.644 1.644 0 1 0 1.172.48 1.6 1.6 0 0 0-1.172-.48Zm5.043 0a1.65 1.65 0 1 0-.009 3.3 1.623 1.623 0 0 0 1.172-.48 1.637 1.637 0 0 0 0-2.34 1.635 1.635 0 0 0-1.182-.48h.019Zm5.044 0a1.644 1.644 0 1 0 1.172.48 1.6 1.6 0 0 0-1.172-.48Z"/><circle cx="12.5" cy="12.5" r="11" fill="none" stroke="currentColor" stroke-width="3" data-name="icon"/></svg></i>
257 <span>»Ì¼¨â¹</span> 258 </a> 259 </div>`; 260 } else if (settings.type == "footer") { 261 var contactHtml = ` 262 <div class="${cName}__contact"> 263 <a class="${cName}-button" href="https://connect.honda.co.jp/support/select_form?hojin_cd=3353533&kanban_no=${prefSetting[shop.pref_name].kanban_cd}&kyoten_cd=${shop.shop_cd}" target="_blank"> 264 <i><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25"><path fill="currentColor" fill-rule="evenodd" d="M7.318 11.29a1.644 1.644 0 1 0 1.172.48 1.6 1.6 0 0 0-1.172-.48Zm5.043 0a1.65 1.65 0 1 0-.009 3.3 1.623 1.623 0 0 0 1.172-.48 1.637 1.637 0 0 0 0-2.34 1.635 1.635 0 0 0-1.182-.48h.019Zm5.044 0a1.644 1.644 0 1 0 1.172.48 1.6 1.6 0 0 0-1.172-.48Z"/><circle cx="12.5" cy="12.5" r="11" fill="none" stroke="currentColor" stroke-width="3" data-name="icon"/></svg></i> 265 <span>±ÌXÜÉâ¢í¹é</span> 266 </a> 267 </div>`; 268 } else { 269 var contactHtml = ` 270 <div class="${cName}__contact"> 271 <a class="${cName}-button" href="https://connect.honda.co.jp/support/select_form?hojin_cd=3353533&kanban_no=${prefSetting[shop.pref_name].kanban_cd}&kyoten_cd=${shop.shop_cd}" target="_blank"> 272 <i><svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13.9 11.375'><path fill='currentColor' fill-rule='evenodd' d='M12.52-.006a1.408 1.408 0 0 1 1.39 1.315v8.634a1.408 1.408 0 0 1-1.28 1.418H1.39A1.4 1.4 0 0 1 0 10.046V1.415A1.408 1.408 0 0 1 1.28-.003h11.24Zm0 2.426L7.69 7.352a1.022 1.022 0 0 1-1.47 0L1.39 2.42v7.523h11.13V2.42Zm-.98-1H2.37L6.95 6.1Z'/></svg></i> 273 <span>±ÌXÜÉâ¢í¹é</span> 274 </a> 275 <a class="${cName}-button" href="/${prefSetting[shop.pref_name].id}/showroom/sr${shop.shop_cd}.html"> 276 <i><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.65 16.81"><path fill="currentColor" fill-rule="evenodd" d="M7.31 10.66a3.28 3.28 0 1 1 3.26-3.28 3.269 3.269 0 0 1-3.26 3.28Zm0-4.92a1.64 1.64 0 1 0 1.63 1.64 1.637 1.637 0 0 0-1.63-1.64Zm0 11.06a2.408 2.408 0 0 1-1.72-.72L2.14 12.6a7.424 7.424 0 0 1 0-10.44 7.279 7.279 0 0 1 10.35 0 7.443 7.443 0 0 1 0 10.44l-3.45 3.48a2.43 2.43 0 0 1-1.73.72Zm0-15.16a5.633 5.633 0 0 0-4.02 1.68 5.77 5.77 0 0 0 0 8.12l3.45 3.48a.809.809 0 0 0 1.15 0l3.45-3.48a5.783 5.783 0 0 0 0-8.12 5.656 5.656 0 0 0-4.03-1.68Zm4.6 10.38Z"/></svg></i> 277 <span>XÜÌÚ×ð©é</span> 278 </a> 279 </div>`; 280 } 281 282 var html = ` 283 <li class="${cName}"> 284 <a class="${cName}__head" href="/${prefSetting[shop.pref_name].id}/showroom/sr${shop.shop_cd}.html"> 285 <i class="${cName}__rank" data-num="${i + 1}">${i + 1}</i> 286 <div class="${cName}__name"> 287 <em>${shop.shop_name}</em> 288 <span>${prefSetting[shop.pref_name].name}</span> 289 </div> 290 <div class="${cName}__distance">${shop.distance}</div> 291 </a> 292 <div class="${cName}__body"> 293 <div class="${cName}__profile"> 294 <div class="${cName}__hour">cÆÔF${shop.hours}</div> 295 <div class="${cName}__close">xXúF${shop.close}</div> 296 <a class="${cName}__tel" href="tel:${shop.tel}"> 297 <i><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 19.031 28.438"><path fill="currentColor" fill-rule="evenodd" d="M2.513.773a2.613 2.613 0 0 1 3.977.351l1.184 1.613a2.7 2.7 0 0 1-.215 3.483l-.223.227a.649.649 0 0 0-.008.294 5.371 5.371 0 0 0 1.719 2.577 5.291 5.291 0 0 0 2.543 1.749.631.631 0 0 0 .3-.009l.382-.389a2.576 2.576 0 0 1 3.1-.426l1.792 1a2.724 2.724 0 0 1 .666 4.26l-1.333 1.352a2.737 2.737 0 0 1-1.673.848c-1.7.161-5.653-.046-9.811-4.268C1.032 9.495.288 6.058.193 4.364l.7-.04-.7.04a2.775 2.775 0 0 1 .853-2.092Zm2.851 1.212a1.227 1.227 0 0 0-1.86-.193l-1.472 1.5a1.325 1.325 0 0 0-.439.992c.075 1.345.675 4.446 4.307 8.135 3.81 3.867 7.328 3.982 8.688 3.853a1.334 1.334 0 0 0 .812-.435l1.331-1.354a1.267 1.267 0 0 0-.344-1.976l-1.791-1a1.191 1.191 0 0 0-1.435.182l-.427.435-.5-.51.5.51-.006.006-.014.013a1.033 1.033 0 0 1-.128.1 1.418 1.418 0 0 1-.3.154 1.934 1.934 0 0 1-1 .084 6.493 6.493 0 0 1-3.323-2.147 6.636 6.636 0 0 1-2.116-3.378 2.037 2.037 0 0 1 .083-1.025 1.451 1.451 0 0 1 .223-.4l.03-.034.013-.014.006-.006.5.508-.5-.508.271-.274a1.241 1.241 0 0 0 .079-1.6ZM2.3 28.438h1.625V21.65h2.31v-1.364H.008v1.364h2.289v6.788Zm5.147 0h5.116v-1.364H9.076v-2.179h2.86v-1.364h-2.86V21.65h3.366v-1.364h-5v8.152Zm6.655 0h4.94v-1.364h-3.311v-6.788h-1.629v8.152Z"/></svg></i>
298 <span>${shop.tel}</span> 299 </a> 300 </div> 301 ${contactHtml} 302 </div> 303 </li>`; 304 appendHtml += html; 305 } 306 } 307 } 308 309 el.html(`<ul class="${settings.container_class}__list"> 310 ${appendHtml} 311 </ul>`); 312 313 $('.' + settings.loading_class).remove(); 314 el.slideDown(); 315 $('.' + settings.button_class).show().css('display', 'block'); 316 } else { 317 alert("ZܽÍXÖÔðü͵ľ³¢B"); 318 $('.' + settings.loading_class).remove(); 319 } 320 }).fail(function () { 321 if (type === 'gps') { 322 alert("ÊuîñT[rXªLøÈ[©ç²p¾³¢B"); 323 } else { 324 alert("ZܽÍXÖÔðü͵ľ³¢B"); 325 } 326 327 $('.' + settings.loading_class).remove(); 328 }); 329 330 /** 331 * 2_ÔÌÜxox©ç£ðæ¾ 332 * ªnüqCZ@ðgpµÄ£ðZo·éB 333 * @see http://hamasyou.com/blog/2010/09/07/post-2/ 334 * @param float Üx1 335 * @param float ox2 336 * @param float Üx2 337 * @param float ox2 338 * @param ¬_ÈºÌ (׫æÅZo¸xðwè) 339 */ 340 341 function getDistance(lat1, lng1, lat2, lng2, precision) { 342 var distance = 0; 343 344 if (Math.abs(lat1 - lat2) < 0.00001 && Math.abs(lng1 - lng2) < 0.00001) { 345 distance = 0; 346 } else { 347 lat1 = lat1 * Math.PI / 180; 348 lng1 = lng1 * Math.PI / 180; 349 lat2 = lat2 * Math.PI / 180; 350 lng2 = lng2 * Math.PI / 180; 351 var A = 6378140; 352 var B = 6356755; 353 var F = (A - B) / A; 354 var P1 = Math.atan(B / A * Math.tan(lat1)); 355 var P2 = Math.atan(B / A * Math.tan(lat2)); 356 var X = Math.acos(Math.sin(P1) * Math.sin(P2) + Math.cos(P1) * Math.cos(P2) * Math.cos(lng1 - lng2)); 357 var L = F / 8 * ((Math.sin(X) - X) * Math.pow(Math.sin(P1) + Math.sin(P2), 2) / Math.pow(Math.cos(X / 2), 2) - (Math.sin(X) - X) * Math.pow(Math.sin(P1) - Math.sin(P2), 2) / Math.pow(Math.sin(X), 2)); 358 distance = A * (X + L); 359 var decimal_no = Math.pow(10, precision); 360 distance = Math.round(decimal_no * distance / 1) / decimal_no; 361 } 362 363 return distance; 364 } 365 }); 366 367 // return for 'Method Chain' end. 368 }; 369 370// end pluginName. 371})(jQuery, window); 372 373function zip(type="",from="address") { 374 // remove shop_type : 'ex' 375 if (typeof gmapArr != 'undefined') { 376 $.each(gmapArr, function(i, v){ 377 if (v.shop_type == 'ex') { 378 delete gmapArr[i]; 379 } 380 }); 381 } 382 383 var nearbyOption = { 384 array: gmapArr, 385 min: 4 386 }; 387 nearbyOption.type = type; 388 nearbyOption.from = from; 389 var suffix = (type == "") ? "" : "-" + type; 390 nearbyOption.input = '#js-nearby-search' + suffix; 391 nearbyOption.button_class = 'js-nearby-result-close' + suffix; 392 $('#js-nearby-result' + suffix).nearby(nearbyOption); 393} 394 395$(function () { 396 $('#js-shopsearch-gps').on('click', function () { 397 zip('', 'gps'); 398 }); 399 $('#js-contact-search-gps-newcar').on('click', function () { 400 zip('newcar', 'gps'); 401 }); 402 $('#js-contact-search-gps-move').on('click', function () { 403 zip('move', 'gps'); 404 }); 405 $('#js-contact-search-gps-other').on('click', function () { 406 zip('other', 'gps'); 407 }); 408 $(document).on({ 409 'click': hideResult 410 }, '.js-nearby-hide'); 411 $(document).on({ 412 'focus': hideResult 413 }, '.js-nearby-search'); 414 415 function hideResult() { 416 $('.c-showroom-nearby__result').slideUp(); 417 $('.c-showroom-nearby__foot').hide(); 418 } 419});
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.