1Object.keys = Object.keys || function(o) { 2 var result = []; 3 for(var name in o) { 4 if (o.hasOwnProperty(name)) 5 result.push(name); 6 } 7 return result; 8}; 9 10jQuery(document).ready(function($){ 11 12 var animationDelay = 0; 13 var enableAnimation, extraColor, greyscale, enableZoom, enableZoomConnect, markerImg, centerlng, centerlat, zoomLevel, latLng, infoWindows; 14 var map = []; 15 var infoWindows = []; 16 17 window.mapAPI_Loaded = function() { 18 19 for(var i = 0; i < $('.nectar-google-map').length; i++) { 20 infoWindows[i] = []; 21 } 22 23 $('.nectar-google-map').each(function(i){ 24 25 /*var $mapCopy = $(this).clone(); 26 var $currentPosition = $(this).next('.map-marker-list'); 27 $(this).remove(); 28 $mapCopy.insertBefore($currentPosition);*/ 29 30 31 //map margin if page header 32 if( $('#page-header-bg:not("[data-parallax=1]")').length > 0 ) { $('#contact-map').css('margin-top', 0); $('.container-wrap').css('padding-top', 0);} 33 if( $('#page-header-bg[data-parallax=1]').length > 0 ) $('#contact-map').css('margin-top', '-30px'); 34 35 zoomLevel = parseFloat($(this).attr('data-zoom-level')); 36 centerlat = parseFloat($(this).attr('data-center-lat')); 37 centerlng = parseFloat($(this).attr('data-center-lng')); 38 markerImg = $(this).attr('data-marker-img'); 39 enableZoom = $(this).attr('data-enable-zoom'); 40 enableZoomConnect = (enableZoom == '1') ? false : true; 41 greyscale = $(this).attr('data-greyscale'); 42 extraColor = $(this).attr('data-extra-color'); 43 ultraFlat = $(this).attr('data-ultra-flat'); 44 darkColorScheme = $(this).attr('data-dark-color-scheme'); 45 var $flatObj = []; 46 var $darkColorObj = []; 47 enableAnimation = $(this).attr('data-enable-animation'); 48 49 if( isNaN(zoomLevel) ) { zoomLevel = 12;} 50 if( isNaN(centerlat) ) { centerlat = 51.47;} 51 if( isNaN(centerlng) ) { centerlng = -0.268199;} 52 if( typeof enableAnimation != 'undefined' && enableAnimation == 1 && $(window).width() > 690) { animationDelay = 180; enableAnimation = google.maps.Animation.BOUNCE } else { enableAnimation = null; } 53 54 latLng = new google.maps.LatLng(centerlat,centerlng); 55 56 //color 57 58 if(ultraFlat == '1') { 59 $flatObj = [{ 60 "featureType": "transit", 61 "elementType": "geometry", 62 "stylers": [ 63 { "visibility": "off" } 64 ] 65 }, 66 { 67 "elementType": "labels", 68 "stylers": [ 69 { "visibility": "off" } 70 ] 71 }, 72 { 73 "featureType": "administrative", 74 "stylers": [ 75 { "visibility": "off" } 76 ] 77 }]; 78 } else { 79 $flatObj[0] = {}; 80 $flatObj[1] = {}; 81 $flatObj[2] = {}; 82 } 83 84 85 if(darkColorScheme == '1') { 86 $darkColorObj = [{ 87 "featureType": "road", 88 "stylers": [ 89 { "visibility": "simple" }, 90 { "color": "#3e3e3e" } 91 ] 92 },{ 93 "featureType": "water", 94 "stylers": [ 95 { "color": "#313131" } 96 ] 97 },{ 98 "featureType": "landscape", 99 "stylers": [ 100 { "color": "#2c2c2c" } 101 ] 102 },{ 103 "featureType": "poi", 104 "stylers": [ 105 { "color": "#3e3e3e" }, 106 { "visibility": "simplified" } 107 ] 108 },{ 109 "featureType": "administrative", 110 "elementType": "geometry.stroke", 111 "stylers": [ 112 { "visibility": "on" }, 113 { "color": "#3e3e3e" } 114 ] 115 }]; 116 } else { 117 $darkColorObj[0] = {}; 118 $darkColorObj[1] = {}; 119 $darkColorObj[2] = {}; 120 $darkColorObj[3] = {}; 121 $darkColorObj[4] = {}; 122 } 123 124 if(greyscale == '1' && extraColor.length > 0) { 125 styles = [ 126 127 { 128 featureType: "poi", 129 elementType: "labels", 130 stylers: [{ 131 visibility: "off" 132 }] 133 }, 134 { 135 featureType: "road.local", 136 elementType: "labels.icon", 137 stylers: [{ 138 "visibility": "off" 139 }] 140 }, 141 { 142 featureType: "road.arterial", 143 elementType: "labels.icon", 144 stylers: [{ 145 "visibility": "off" 146 }] 147 }, 148 { 149 featureType: "road", 150 elementType: "geometry.stroke", 151 stylers: [{ 152 visibility: "off" 153 }] 154 }, 155 { 156 featureType: "transit", 157 elementType: "geometry.fill", 158 stylers: [ 159 { hue: extraColor }, 160 { visibility: "on" }, 161 { lightness: 1 }, 162 { saturation: 7 } 163 ] 164 }, 165 { 166 elementType: "labels", 167 stylers: [{ 168 saturation: -100, 169 }] 170 }, 171 { 172 featureType: "poi", 173 elementType: "geometry.fill", 174 stylers: [ 175 { hue: extraColor }, 176 { visibility: "on" }, 177 { lightness: 20 }, 178 { saturation: 7 } 179 ] 180 }, 181 { 182 featureType: "landscape", 183 stylers: [ 184 { hue: extraColor }, 185 { visibility: "on" }, 186 { lightness: 20 }, 187 { saturation: 20 } 188 ] 189 190 }, 191 { 192 featureType: "road", 193 elementType: "geometry.fill", 194 stylers: [ 195 { hue: extraColor }, 196 { visibility: "on" }, 197 { lightness: 1 }, 198 { saturation: 7 } 199 ] 200 }, 201 { 202 featureType: "water", 203 elementType: "geometry", 204 stylers: [ 205 { hue: extraColor }, 206 { visibility: "on" }, 207 { lightness: 1 }, 208 { saturation: 7 } 209 ] 210 }, 211 $darkColorObj[0], 212 $darkColorObj[1], 213 $darkColorObj[2], 214 $darkColorObj[3], 215 $darkColorObj[4], 216 $flatObj[0], 217 $flatObj[1], 218 $flatObj[2] 219 ]; 220 221 } 222 223 224 225 else if(greyscale == '1'){ 226 227 styles = [ 228 229 { 230 featureType: "poi", 231 elementType: "labels", 232 stylers: [{ 233 visibility: "off" 234 }] 235 }, 236 { 237 featureType: "road.local", 238 elementType: "labels.icon", 239 stylers: [{ 240 "visibility": "off" 241 }] 242 }, 243 { 244 featureType: "road.arterial", 245 elementType: "labels.icon", 246 stylers: [{ 247 "visibility": "off" 248 }] 249 }, 250 { 251 featureType: "road", 252 elementType: "geometry.stroke", 253 stylers: [{ 254 visibility: "off" 255 }] 256 }, 257 { 258 elementType: "geometry", 259 stylers: [{ 260 saturation: -100 261 }] 262 }, 263 { 264 elementType: "labels", 265 stylers: [{ 266 saturation: -100 267 }] 268 }, 269 { 270 featureType: "poi", 271 elementType: "geometry.fill", 272 stylers: [{ 273 color: "#ffffff" 274 }] 275 }, 276 { 277 featureType: "landscape", 278 stylers: [{ 279 color: "#ffffff" 280 }] 281 }, 282 { 283 featureType: "road", 284 elementType: "geometry.fill", 285 stylers: [ { 286 color: "#f1f1f1" 287 }] 288 }, 289 { 290 featureType: "water", 291 elementType: "geometry", 292 stylers: [{ 293 color: "#b9e7f4" 294 }] 295 }, 296 $darkColorObj[0], 297 $darkColorObj[1], 298 $darkColorObj[2], 299 $darkColorObj[3], 300 $darkColorObj[4], 301 $flatObj[0], 302 $flatObj[1], 303 $flatObj[2] 304 ]; 305 306 307 } 308 309 310 else { 311 styles = []; 312 } 313 314 var styledMap = new google.maps.StyledMapType(styles, 315 {name: "Styled Map"}); 316 317 318 //options 319 var mapOptions = { 320 center: latLng, 321 zoom: zoomLevel, 322 mapTypeControlOptions: { 323 mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'map_style'] 324 }, 325 scrollwheel: false, 326 panControl: false, 327 zoomControl: enableZoom, 328 disableDoubleClickZoom: enableZoomConnect, 329 zoomControlOptions: { 330 style: google.maps.ZoomControlStyle.LARGE, 331 position: google.maps.ControlPosition.LEFT_CENTER 332 }, 333 mapTypeControl: false, 334 scaleControl: false, 335 streetViewControl: false 336 337 }; 338 339 map[i] = new google.maps.Map(document.getElementById($(this).attr('id')), mapOptions); 340 341 //Associate the styled map with the MapTypeId and set it to display. 342 map[i].mapTypes.set('map_style', styledMap); 343 map[i].setMapTypeId('map_style'); 344 345 var $count = i; 346 347 google.maps.event.addListenerOnce(map[i], 'tilesloaded', function() { 348 349 var map_id = $(map[i].getDiv()).attr('id'); 350 351 //don't start the animation until the marker image is loaded if there is one 352 if(markerImg.length > 0) { 353 var markerImgLoad = new Image(); 354 markerImgLoad.src = markerImg; 355 356 $(markerImgLoad).load(function(){ 357 setMarkers(map[i], map_id, $count); 358 });
359 360 } 361 else { 362 setMarkers(map[i], map_id, $count); 363 } 364 }); 365 366 }); 367 368 } 369 370 if(typeof google == 'undefined') { 371 $.getScript('https://maps.google.com/maps/api/js?sensor=false&callback=mapAPI_Loaded'); 372 } else { 373 374 $(window).on("pronto.render", function(){ 375 mapAPI_Loaded(); 376 }); 377 378 //$(window).trigger('resize'); 379 //mapAPI_Loaded(); 380 //setTimeout(function(){ $(window).trigger('resize'); },200); 381 382 } 383 384 function setMarkers(map,map_id,count) { 385 386 387 $('.map-marker-list.'+map_id).each(function(){ 388 389 var enableAnimation = $('#'+map_id).attr('data-enable-animation'); 390 391 $(this).find('.map-marker').each(function(i){ 392 393 var marker = new google.maps.Marker({ 394 position: new google.maps.LatLng($(this).attr('data-lat'), $(this).attr('data-lng')), 395 map: map, 396 visible: false, 397 mapIndex: count, 398 infoWindowIndex : i, 399 icon: $('#'+map_id).attr('data-marker-img'), 400 optimized: false 401 }); 402 403 //animation 404 if(typeof enableAnimation != 'undefined' && enableAnimation == 1 && $(window).width() > 690) { 405 setTimeout(function() { 406 marker.setAnimation(google.maps.Animation.BOUNCE); 407 marker.setOptions({ visible: true }); 408 setTimeout(function(){marker.setAnimation(null);},500); 409 }, i * 200); 410 } else { 411 marker.setOptions({ visible: true }); 412 } 413 414 //infowindows 415 if($(this).attr('data-mapinfo') != '' && $(this).attr('data-mapinfo') != '<br />' && $(this).attr('data-mapinfo') != '<br/>') { 416 var infowindow = new google.maps.InfoWindow({ 417 content: $(this).attr('data-mapinfo'), 418 maxWidth: 300 419 }); 420 421 infoWindows[count].push(infowindow); 422 423 google.maps.event.addListener(marker, 'click', (function(marker, i) { 424 return function() { 425 infoWindows[this.mapIndex][this.infoWindowIndex].open(map, this); 426 } 427 428 })(marker, i)); 429 } 430 431 432 }); 433 434 }); 435 436 437 }//setMarker 438 439});
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.