1/*global google, $, Modernizr, InfoBox, window, alert, setTimeout,mapbase_vars*/ 2 3wp_estate_kind_of_map = parseInt(mapbase_vars.wp_estate_kind_of_map); 4var lealet_map_move_on_hover = 0; 5var propertyMarker_submit = ''; 6var leaflet_map_move_flag = 0; 7 8 9 10 11function wpresidence_map_general_start_map(page_map){ 12 "use strict"; 13 var zoom_level; 14 if(page_map=='prop'){ 15 zoom_level=parseInt(googlecode_property_vars.page_custom_zoom, 10); 16 }else{ 17 zoom_level=parseInt(googlecode_regular_vars.page_custom_zoom, 10); 18 } 19 20 21 22 if(wp_estate_kind_of_map===1){ 23 wpresidence_google_start_map(zoom_level); 24 }else if(wp_estate_kind_of_map===2){ 25 wpresidence_leaflet_start_map(zoom_level); 26 } 27} 28 29 30 31 32 33 34 35function wpresidence_leaflet_start_map(zoom_level){ 36 "use strict"; 37// ready 38 39 if (typeof(curent_gview_long)==='undefined' || curent_gview_lat === '' || curent_gview_long === '0') { 40 if( typeof(googlecode_property_vars)!=='undefined' ){ 41 curent_gview_lat = googlecode_property_vars.general_latitude; 42 } 43 44 if( typeof(googlecode_regular_vars)!=='undefined' ){ 45 curent_gview_lat = googlecode_regular_vars.general_latitude; 46 } 47 } 48 49 if ( typeof(curent_gview_long)==='undefined' || curent_gview_long === '' || curent_gview_long === '0') { 50 if( typeof(googlecode_property_vars)!=='undefined' ){ 51 curent_gview_long = googlecode_property_vars.general_longitude; 52 } 53 if( typeof(googlecode_regular_vars)!=='undefined' ){ 54 curent_gview_long = googlecode_regular_vars.general_longitude; 55 } 56 } 57 58 59 60 61 var mapCenter = L.latLng( curent_gview_lat,curent_gview_long ); 62 63 if (document.getElementById('googleMap')) { 64 65 map = L.map( 'googleMap',{ 66 center: mapCenter, 67 zoom: zoom_level, 68 69 }).on('load', function(e) { 70 jQuery('#gmap-loading').remove(); 71 }); 72 73 } else if (document.getElementById('googleMapSlider')) { 74 map = L.map( 'googleMapSlider',{ 75 center: mapCenter, 76 zoom: zoom_level 77 }).on('load', function(e) { 78 jQuery('#gmap-loading').remove(); 79 }); 80 81 }else{ 82 return; 83 } 84 85 wpresidence_leaflet_initialize_map_common(map); 86 87 88 89} 90 91 92 93function wpresidence_leaflet_initialize_map_common(map){ 94 95 var tileLayer = wpresidence_open_stret_tile_details(); 96 map.addLayer( tileLayer ); 97 98 map.scrollWheelZoom.disable(); 99 if ( Modernizr.mq('only all and (max-width: 768px)') ) { 100 map.dragging.disable(); 101 } 102 // map.touchZoom.disable(); 103 104 map.on('popupopen', function(e) { 105 lealet_map_move_on_hover=1; 106 107 if( jQuery('#google_map_prop_list_wrapper').length==0 ){ 108 var px = map.project(e.popup._latlng); // find the pixel location on the map where the popup anchor is 109 if( mapfunctions_vars.useprice === 'yes' ){ 110 px.y -= 115; // find the height of the popup container, divide by 2, subtract from the Y axis of marker location 111 }else{ 112 px.y -= 320/2; // find the height of the popup container, divide by 2, subtract from the Y axis of marker location 113 } 114 map.panTo(map.unproject(px),{animate: true}); // pan to new center 115 } 116 117 lealet_map_move_on_hover=1; 118 }); 119 120 jQuery('#gmap-loading').remove(); 121 map.on('load', function(e) { 122 jQuery('#gmap-loading').remove(); 123 }); 124 //if (Modernizr.mq('only all and (max-width: 1025px)')) { } 125 126 127 if ( Modernizr.mq('only all and (max-width: 768px)') ) { 128 map.on('dblclick ', function(e) { 129 if (map.dragging.enabled()) { 130 map.dragging.disable(); 131 //map.touchZoom.disable(); 132 }else{ 133 map.dragging.enable(); 134 //map.touchZoom.enable(); 135 } 136 }); 137 } 138 139 140 141 142 143
144 markers_cluster=L.markerClusterGroup({ 145 146 iconCreateFunction: function(cluster) { 147 return L.divIcon({ html: '<div class="leaflet_cluster" style="background-image: url('+images['cloud_pin']+')">' + cluster.getChildCount() + '</div>' }); 148 }, 149 }); 150 151} 152 153 154function wpresidence_leaflet_map_cluster(){ 155 map.addLayer(markers_cluster); 156} 157 158function wprentals_map_general_map_pan_move(){ 159 if(wp_estate_kind_of_map===1){ 160 wprentals_google_map_pan_move(); 161 }else if(wp_estate_kind_of_map===2){ 162 wprentals_leaflet_map_pan_move(); 163 }else if(wp_estate_kind_of_map===3){ 164 165 } 166 167 168} 169 170 171function wpresidence_open_stret_tile_details(){ 172 173 // tile.openstreetmap.se/hydda/full/{z}/{x}/{y}.png 174 // tile.openstreetmap.se/hydda/full/{z}/{x}/{y}.png) 175 // https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png 176 177 178 if( mapbase_vars.wp_estate_mapbox_api_key==='' ){ 179 var tileLayer = L.tileLayer( 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { 180 attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' 181 } ); 182 183 }else{ 184 var tileLayer = L.tileLayer( 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token='+mapbase_vars.wp_estate_mapbox_api_key, { 185 attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', 186 maxZoom: 18, 187 id: 'mapbox.streets', 188 accessToken: 'your.mapbox.access.token' 189 } 190 ); 191 } 192 return tileLayer; 193} 194 195 196function wpresidence_google_start_map(zoom_level){ 197 "use strict"; 198 var mapOptions, styles; 199 200 if(jQuery('#googleMap').hasClass('full_height_map')){ 201 var new_height = jQuery( window ).height() - jQuery('.master_header').height(); 202 jQuery('#googleMap,#gmap_wrapper').css('height',new_height); 203 } 204 205 206 207 if (typeof(curent_gview_long)==='undefined' || curent_gview_lat === '' || curent_gview_lat === '0') { 208 if( typeof(googlecode_property_vars)!=='undefined' ){ 209 curent_gview_lat = googlecode_property_vars.general_latitude; 210 } 211 212 if( typeof(googlecode_regular_vars)!=='undefined' ){ 213 curent_gview_lat = googlecode_regular_vars.general_latitude; 214 } 215 } 216 217 if ( typeof(curent_gview_long)==='undefined' || curent_gview_long === '' || curent_gview_long === '0') { 218 if( typeof(googlecode_property_vars)!=='undefined' ){ 219 curent_gview_long = googlecode_property_vars.general_longitude; 220 } 221 if( typeof(googlecode_regular_vars)!=='undefined' ){ 222 curent_gview_long = googlecode_regular_vars.general_longitude; 223 } 224 } 225 226 if( typeof(googlecode_regular_vars)!=='undefined' ){ 227 var map_type =googlecode_regular_vars.type.toLowerCase(); 228 }else if( typeof(googlecode_property_vars)!=='undefined' ){ 229 var map_type =googlecode_property_vars.type.toLowerCase(); 230 } 231 232 233 234 var with_bound=0; 235 var mapOptions = { 236 flat:false, 237 noClear:false, 238 zoom: parseInt(zoom_level), 239 scrollwheel: false, 240 draggable: true, 241 center: new google.maps.LatLng(curent_gview_lat,curent_gview_long), 242 mapTypeId: map_type, 243 streetViewControl:false, 244 disableDefaultUI: true, 245 gestureHandling: 'cooperative' 246 }; 247 248 249 250 251 252 253 254 255 if( document.getElementById('googleMap') ){ 256 map = new google.maps.Map(document.getElementById('googleMap'), mapOptions); 257 }else if( document.getElementById('googleMapSlider') ){ 258 map = new google.maps.Map(document.getElementById('googleMapSlider'), mapOptions); 259 } else{ 260 return; 261 } 262 263 264 265 google.maps.visualRefresh = true; 266 267 if(mapfunctions_vars.show_g_search_status==='yes'){ 268 wpestate_set_google_search(map); 269 } 270 271 if(mapfunctions_vars.map_style !==''){ 272 var styles = JSON.parse ( mapfunctions_vars.map_style ); 273 map.setOptions({styles: styles}); 274 } 275 276 google.maps.event.addListener(map, 'tilesloaded', function() { 277 jQuery('#gmap-loading').remove(); 278 }); 279 280 281} 282 283 284 285function wpresidence_map_general_set_markers(map, markers,with_bound){ 286 "use strict"; 287 wpresidence_google_setMarkers2(map, markers,with_bound); 288} 289 290 291 292function wpresidence_google_setMarkers2 (map, locations){ 293 "use strict"; 294 295 var map_open; 296 var myLatLng; 297 var selected_id = parseInt( jQuery('#gmap_wrapper').attr('data-post_id') ); 298 if( isNaN(selected_id) ){ 299 selected_id = parseInt( jQuery('#googleMapSlider').attr('data-post_id'),10 ); 300 } 301 302 var open_height = parseInt(mapfunctions_vars.open_height,10); 303 var closed_height = parseInt(mapfunctions_vars.closed_height,10); 304 var boxText = document.createElement("div"); 305 width_browser = jQuery(window).width(); 306 307 infobox_width = 700; 308 vertical_pan = -215; 309 310 if (width_browser<900){ 311 infobox_width=500; 312 } 313 314 if (width_browser<600){ 315 infobox_width=400; 316 } 317 318 if (width_browser<400){ 319 infobox_width=200; 320 } 321 322 323 if(wp_estate_kind_of_map===1){ 324 bounds = new google.maps.LatLngBounds(); 325 } 326 327 328 329 for (var i = 0; i < locations.length; i++) { 330 var beach = locations[i]; 331 var id = beach[10]; 332 var lat = beach[1]; 333 var lng = beach[2]; 334 var title = decodeURIComponent ( beach[0] ); 335 var pin = beach[8]; 336 var counter = beach[3]; 337 var image = decodeURIComponent ( beach[4] ); 338 var price = decodeURIComponent ( beach[5] ); 339 var single_first_type = decodeURIComponent ( beach[6] ); 340 var single_first_action = decodeURIComponent ( beach[7] ); 341 var link = decodeURIComponent ( beach[9] ); 342 var cleanprice = beach[11]; 343 var rooms = beach[12]; 344 var baths = beach[13]; 345 var size = beach[14]; 346 var single_first_type_name = decodeURIComponent ( beach[
34615] ); 347 var single_first_action_name = decodeURIComponent ( beach[16] ); 348 var pin_price = decodeURIComponent ( beach[17] ); 349 350 351 352 // found the property 353 if(selected_id===id){ 354 found_id=i; 355 } 356 357 if(wp_estate_kind_of_map===1){ 358 wpestate_createMarker ( pin_price,size, i,id,lat,lng,pin,title,counter,image,price,single_first_type,single_first_action,link,rooms,baths,cleanprice,single_first_type_name, single_first_action_name); 359 }else if(wp_estate_kind_of_map===2){ 360 361 wpresidence_createMarker_leaflet ( pin_price,size, i,id,lat,lng,pin,title,counter,image,price,single_first_type,single_first_action,link,rooms,baths,cleanprice,single_first_type_name, single_first_action_name); 362 363 } 364 365 }//end for 366 367} 368 369function wpresidence_map_general_cluster(){ 370 "use strict"; 371 372 if(wp_estate_kind_of_map===1){ 373 wpestate_map_cluster(); 374 }else if(wp_estate_kind_of_map===2){ 375 wpresidence_leaflet_map_cluster(); 376 } 377 378} 379 380function wpresidence_map_general_fit_to_bounds(with_bound){ 381 "use strict"; 382 383 if(wp_estate_kind_of_map===1){ 384 wpresidence_google_fit_to_bounds(with_bound); 385 }else if(wp_estate_kind_of_map===2){ 386 wpresidence_leaflet_fit_to_bounds(with_bound); 387 } 388 389} 390 391 392function wpresidence_map_panorama(){ 393 "use strict"; 394 395 if( parseInt(mapbase_vars.wp_estate_kind_of_map) == 2){ 396 return; 397 } 398 var viewPlace=new google.maps.LatLng(curent_gview_lat,curent_gview_long); 399 400 panorama = map.getStreetView(); 401 panorama.setPosition(viewPlace); 402 heading = parseInt(googlecode_property_vars.camera_angle); 403 404 panorama.setPov(/** @type {google.maps.StreetViewPov} */({ 405 heading: heading, 406 pitch: 0 407 })); 408 409 google.maps.event.addListener(panorama, "closeclick", function() { 410 jQuery('#gmap-next,#gmap-prev ,#geolocation-button,#gmapzoomminus,#gmapzoomplus').show(); 411 jQuery('#street-view').removeClass('mapcontrolon'); 412 }); 413 414} 415 416 417 418function wpresidence_google_fit_to_bounds(with_bound){ 419 "use strict"; 420 421 if (document.getElementById('google_map_prop_list')) { 422 423 424 }else if (document.getElementById('googleMap')) { 425 if(with_bound===1){ 426 if (typeof( bounds) !== 'undefined' && !bounds.isEmpty()) { 427 428 wpestate_fit_bounds(bounds); 429 }else{ 430 wpestate_fit_bounds_nolsit(); 431 } 432 } 433 } 434} 435 436 437 438 439 440function wpresidence_map_general_spiderfy(){ 441 "use strict"; 442 if(wp_estate_kind_of_map===1){ 443 if( !jQuery('body').hasClass('single-estate_property') ){ 444 oms = new OverlappingMarkerSpiderfier(map, {markersWontMove: true, markersWontHide: true,keepSpiderfied :true,legWeight:2}); 445 wpestate_setOms(gmarkers); 446 } 447 }else if(wp_estate_kind_of_map===2){ 448 // no school no job no problem 449 } 450} 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467function wpresidence_leaflet_fit_to_bounds(with_bound){ 468 if(with_bound===1){ 469 470 if (bounds_list.isValid()) { 471 472 473 if(mapfunctions_vars.bypass_fit_bounds!=='1'){ 474 wpestate_fit_bounds_leaflet(bounds_list); 475 } 476 }else{ 477 wpestate_fit_bounds_nolsit_leaflet(); 478 } 479 } 480} 481 482 483 484 485 486 487function wpestate_fit_bounds_leaflet(bounds){ 488 489 is_fit_bounds_zoom=1; 490 491 if(placeCircle!=''){ 492 map.fitBounds(placeCircle.getBounds());// placecircle is google geolocation 493 }else{ 494 if(gmarkers.length===1){ 495 var center = gmarkers[0].getLatLng(); 496 map.panTo(center); 497 map.setZoom(10); 498 is_fit_bounds_zoom=0; 499 500 }else{ 501 map.fitBounds(bounds); 502 is_fit_bounds_zoom=0; 503 } 504 } 505 506 507} 508 509 510function wprentals_leaflet_map_pan_move(){ 511 if (googlecode_regular_vars.on_demand_pins==='yes' && mapfunctions_vars.is_tax!=1 && mapfunctions_vars.is_property_list==='1'){ 512 map.on('moveend', function(e) { 513 wpestate_ondenamd_map_moved_leaflet(); 514 }); 515 516 } 517} 518 519 520 521 522 523 524 525 526 527function wprentals_google_map_pan_move(){ 528 if (googlecode_regular_vars.on_demand_pins==='yes' && mapfunctions_vars.is_tax!=1 && mapfunctions_vars.is_property_list==='1'){ 529 map.addListener('idle', function() { 530 wpestate_ondenamd_map_moved(); 531 }); 532 } 533} 534 535 536 537function wpresidence_createMarker_leaflet ( pin_price,size, i,id,lat,lng,pin,title,counter,image,price,single_first_type,single_first_action,link,rooms,baths,cleanprice,single_first_type_name, single_first_action_name){ 538 "use strict"; 539 540 541 var infoboxWrapper = document.createElement( "div" ); 542 infoboxWrapper.className = 'leafinfobox-wrapper'; 543 var infobox = ""; 544 545 var poss=0; 546 var infobox_class=" price_infobox "; 547 548 549 var price2=price; 550 var my_custom_curr_pos = parseFloat( wpestate_getCookie_map('my_custom_curr_pos')); 551 if (!isNaN(my_custom_curr_pos) && my_custom_curr_pos !== -1) { 552 var converted_price= wpestate_get_price_currency(cleanprice,cleanprice); 553 var testRE = price.match('</span>(.*)<span class='); 554 if (testRE !== null ){ 555 price2=price.replace(testRE[1],converted_price); 556 } 557 } 558 559 560 561 if( mapfunctions_vars.useprice === 'yes' ){ 562 infobox_class =' openstreet_map_price_infobox '; 563 } 564 565 566 var info_image=''; 567 if (image === '') { 568 info_image = mapfunctions_vars.path + '/idxdefault.jpg'; 569 } else { 570 info_image = image; 571 } 572 573 var category = decodeURIComponent(single_first_type.replace(/-/g, ' ')); 574 var action = decodeURIComponent(single_first_action.replace(/-/g, ' ')); 575 var category_name = decodeURIComponent(single_first_type_name.replace(/-/g, ' ')); 576 var action_name = decodeURIComponent(single_first_action_name.replace(/-/g, ' ')); 577 578 var in_type = mapfunctions_vars.in_text; 579 if (category === '' || action === '') { 580 in_type = " "; 581 } 582 in_type = " / "; 583 var infoguest,inforooms; 584 585 var infobaths; 586 if(baths!=''){ 587 infobaths ='<span id="infobath">'+baths+'</span>'; 588 }else{ 589 infobaths =''; 590 } 591 592 593 var inforooms; 594 if(rooms!=''){ 595 inforooms='<span id="inforoom">'+rooms+'</span>'; 596 }else{ 597 inforooms=''; 598 } 599 600 var infosize; 601 if(size!=''){ 602 infosize ='<span id="infosize">'+size+'</span>'; 603 }else{ 604 infosize=''; 605 } 606 607 var title= title.substr(0, 45); 608 if(title.length > 45){ 609 title=title+"..."; 610 } 611 612 613 614 infobox += '<div class="info_details '+infobox_class+'"><a id="infocloser" onClick=\'javascript:jQuery(".leaflet-popup-close-button")[0].click();\' ></a><div class="infobox_wrapper_image"><a href="'+link+'">'+info_image+'</a></div><a href="'+link+'" id="infobox_title">'+title+'</a><div class="prop_detailsx">
614'+category_name+" "+in_type+" "+action_name+'</div><div class="prop_pricex">'+wpestate_get_price_currency(price,cleanprice)+infosize+infobaths+inforooms+'</div></div>'; 615 616 var markerOptions = { 617 riseOnHover: true 618 }; 619 620 var markerCenter = L.latLng( lat, lng ); 621 var propertyMarker = ''; 622 623 624 625 if( mapfunctions_vars.useprice === 'yes' ){ 626 627 var price2=price; 628 var my_custom_curr_pos = parseFloat( wpestate_getCookie_map('my_custom_curr_pos')); 629 if (!isNaN(my_custom_curr_pos) && my_custom_curr_pos !== -1) { 630 var converted_price= wpestate_get_price_currency(cleanprice,cleanprice); 631 var testRE = price.match('</span>(.*)<span class='); 632 if (testRE !== null ){ 633 price2=price.replace(testRE[1],converted_price); 634 } 635 } 636 637 638 var price_pin_class= 'wpestate_marker openstreet_price_marker '+wpestate_makeSafeForCSS(single_first_type_name.trim() )+' '+wpestate_makeSafeForCSS(single_first_action_name.trim()); 639 640 var pin_price_marker = '<div class="'+price_pin_class+'">'; 641 if (typeof(price) !== 'undefined') { 642 if( mapfunctions_vars.use_price_pins_full_price==='no'){ 643 pin_price_marker +='<div class="interior_pin_price">'+pin_price+'</div>'; 644 }else{ 645 646 pin_price_marker +='<div class="interior_pin_price">'+price2+'</div>'; 647 } 648 } 649 pin_price_marker += '</div>'; 650 651 652 653 var myIcon = L.divIcon({ 654 className:'someclass', 655 iconSize: new L.Point(0, 0), 656 html: pin_price_marker 657 }); 658 propertyMarker = L.marker( markerCenter, {icon: myIcon} ); 659 660 }else{ 661 var markerImage = { 662 iconUrl: wprentals_custompin_leaflet(pin), 663 iconSize: [44, 50], 664 iconAnchor: [20, 50], 665 popupAnchor: [1, -50] 666 }; 667 markerOptions.icon = L.icon( markerImage ); 668 propertyMarker = L.marker( markerCenter, markerOptions ); 669 } 670 671 propertyMarker.idul = id; 672 propertyMarker.pin = pin; 673 674 if (mapfunctions_vars.user_cluster === 'yes') { 675 markers_cluster.addLayer(propertyMarker); 676 }else{ 677 propertyMarker.addTo( map ); 678 } 679 680 gmarkers.push(propertyMarker); 681 682 if (typeof (bounds_list) !== "undefined") { 683 bounds_list.extend(propertyMarker.getLatLng()); 684 }else{ 685 686 bounds_list = L.latLngBounds( propertyMarker.getLatLng(),propertyMarker.getLatLng() ); 687 } 688 689 infoboxWrapper.innerHTML = infobox; 690 propertyMarker.bindPopup( infobox ); 691 692 693// if (mapfunctions_vars.generated_pins !== '0') { 694// if(map_is_pan===0){ 695// wpestate_pan_to_last_pin(markerCenter); 696// } 697// map_is_pan=1; 698// } 699 700 701 702} 703 704 705 706 707 708 709 710 711 712 713 714function wprentals_custompinchild_leaflet(image) { 715 "use strict"; 716 var custom_img; 717 var extension=''; 718 var ratio = jQuery(window).dense('devicePixelRatio'); 719 720 if(ratio>1){ 721 extension='_2x'; 722 } 723 724 if (images['userpin'] === '') { 725 custom_img = mapfunctions_vars.path + '/' + 'userpin' +extension+ '.png'; 726 } else { 727 custom_img = images['userpin']; 728 if(ratio>1){ 729 custom_img=wpestate_get_custom_retina_pin(custom_img); 730 } 731 } 732 733 734 735 return custom_img;; 736} 737 738function wprentals_custompin_leaflet(image) { 739 "use strict"; 740 if( mapfunctions_vars.useprice === 'yes' ){ 741 return mapfunctions_vars.path + '/pixel.png'; 742 } 743 744 var custom_img = ''; 745 var extension = ''; 746 var ratio = jQuery(window).dense('devicePixelRatio'); 747 748 if(ratio>1){ 749 extension='_2x'; 750 } 751 752 if(mapfunctions_vars.use_single_image_pin==='no'){ 753 754 if (image !== '') { 755 if (images[image] === '') { 756 custom_img = mapfunctions_vars.path + '/' + image + extension + '.png'; 757 } else { 758 custom_img = images[image]; 759 if(ratio>1){ 760 custom_img=wpestate_get_custom_retina_pin(custom_img); 761 } 762 } 763 } else { 764 custom_img = images['single_pin']; 765 } 766 }else{ 767 if(ratio>1){ 768 custom_img= wpestate_get_custom_retina_pin( images['single_pin'] ); 769 }else{ 770 custom_img= images['single_pin']; 771 } 772 } 773 774 775 776 if (typeof (custom_img) === 'undefined') { 777 custom_img =images['single_pin']; 778 } 779 return custom_img; 780} 781 782function wprentals_map_resize(){ 783 if(wp_estate_kind_of_map===1){ 784 google.maps.event.trigger(map, "resize"); 785 }else if(wp_estate_kind_of_map===2){ 786 map.invalidateSize(); 787 }else if(wp_estate_kind_of_map===3){ 788 789 } 790} 791 792 793 794 795 796 797 798 799 800 801 802 803function wprentals_initialize_map_submit_leaflet(){ 804 805 806 var listing_lat = jQuery('#property_latitude').val(); 807 var listing_lon = jQuery('#property_longitude').val(); 808 809 if (listing_lat === '' || listing_lat === 0 || listing_lat === '0') { 810 listing_lat = google_map_submit_vars.general_latitude; 811 } 812 813 if (listing_lon === '' || listing_lon === 0 || listing_lon === '0') { 814 listing_lon = google_map_submit_vars.general_longitude; 815 } 816 817 var mapCenter = L.latLng( listing_lat,listing_lon ); 818 819 820 if (document.getElementById('googleMapsubmit')) { 821 map = L.map( 'googleMapsubmit',{ 822 center: mapCenter, 823 zoom: 17 824 }).on('load', function(e) { 825 826 }); 827 map_intern = 1; 828 829 830 831 var tileLayer = wpresidence_open_stret_tile_details(); 832 833 map.addLayer( tileLayer ); 834 map.on('click', function(e){ 835 map.removeLayer( propertyMarker_submit ) 836 var markerCenter = L.latLng( e.latlng); 837 propertyMarker_submit = L.marker(e.latlng).addTo(map);; 838 propertyMarker_submit.bindPopup('<div class="submit_leaflet_admin">Latitude: ' + e.latlng.lat + ' Longitude: ' + e.latlng.lng+'</div>').openPopup(); 839 jQuery("#property_latitude").val ( e.latlng.lat) ; 840 jQuery("#property_longitude").val ( e.latlng.lng) ; 841 842 843 }); 844 845 846 var markerCenter = L.latLng( listing_lat,listing_lon ); 847 propertyMarker_submit = L.marker( markerCenter ).addTo(map); 848 propertyMarker_submit.bindPopup('<div class="submit_leaflet_admin">Latitude: ' + listing_lat + ' Longitude: ' + listing_lon+'</div>'); 849 850 setTimeout(function(){ propertyMarker_submit.openPopup(); }, 600); 851 } 852} 853 854 855 856 857 858 859function wpresidence_map_resise(){ 860 if(wp_estate_kind_of_map===1){ 861 google.maps.event.addListenerOnce(map, 'idle', function() { 862 setTimeout(function(){google.maps.event.trigger(map, 'resize'); }, 600); 863 }); 864 865 }else if(wp_estate_kind_of_map===2){ 866 map.invalidateSize(); 867 setTimeout(function(){ map.invalidateSize(); }, 600); 868 } 869}
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.