1/*global google, $, Modernizr,googlecode_property_vars,map,jQuery,mapfunctions_vars,L,curent_gview_lat,curent_gview_long,googlecode_regular_vars,wprentals_google_map_cluster, mapbase_vars,wprentals_map_type,InfoBox, window, alert, setTimeout,*/ 2 3wprentals_map_type = parseInt(mapbase_vars.wprentals_map_type); 4 5var lealet_map_move_on_hover = 0; 6var propertyMarker_submit = ''; 7var leaflet_map_move_flag = 0; 8var wpestate_hover_action_flag = 0; 9window.initMap = function () { 10 11} 12 13 14function wprentals_map_general_start_map(page_map){ 15 "use strict"; 16 var zoom_level; 17 if(page_map=='prop'){ 18 zoom_level=parseInt(googlecode_property_vars.page_custom_zoom, 10); 19 }else{ 20 zoom_level=parseInt(googlecode_regular_vars.page_custom_zoom, 10); 21 } 22 23 if(wprentals_map_type===1){ 24 wprentals_google_start_map(zoom_level); 25 }else if(wprentals_map_type===2){ 26 wprentals_leaflet_start_map(zoom_level); 27 }else if(wprentals_map_type===3){ 28 29 } 30} 31 32 33 34 35function wprentals_map_general_set_markers(map, markers){ 36 "use strict"; 37 wprentals_google_setMarkers2(map, markers); 38} 39 40function wprentals_map_general_cluster(){ 41 "use strict"; 42 // if map is not initialized there is nothing to cluster 43 if (typeof map === 'undefined' || !map) { 44 return; 45 } 46 47 if(wprentals_map_type===1){ 48 wprentals_google_map_cluster(); 49 }else if(wprentals_map_type===2){ 50 wprentals_leaflet_map_cluster(); 51 }else if(wprentals_map_type===3){ 52 53 } 54 55} 56 57function wprentals_leaflet_map_cluster(){ 58 "use strict"; 59 if (typeof map === 'undefined' || !map) { 60 return; 61 } 62 map.addLayer(markers_cluster); 63} 64 65 66function wprentals_map_general_fit_to_bounds(){ 67 "use strict"; 68 if(wprentals_map_type===1){ 69 wprentals_google_fit_to_bounds(); 70 }else if(wprentals_map_type===2){ 71 wprentals_leaflet_fit_to_bounds(); 72 }else if(wprentals_map_type===3){ 73 74 } 75 76} 77 78 79 80function wprentals_map_general_map_pan_move(){ 81 "use strict"; 82 if(wprentals_map_type===1){ 83 wprentals_google_map_pan_move(); 84 }else if(wprentals_map_type===2){ 85 wprentals_leaflet_map_pan_move(); 86 }else if(wprentals_map_type===3){ 87 88 } 89 90 91} 92 93function wprentals_leaflet_start_map(zoom_level){ 94 "use strict"; 95 //if(typeof(map)==='undefined'){ 96 // return; 97 //} 98 99 100 if (typeof(curent_gview_long)==='undefined' || curent_gview_lat === '' || curent_gview_long === '0') { 101 if( typeof(googlecode_property_vars)!=='undefined' ){ 102 curent_gview_lat = googlecode_property_vars.general_latitude; 103 } 104 105 if( typeof(googlecode_regular_vars)!=='undefined' ){ 106 curent_gview_lat = googlecode_regular_vars.general_latitude; 107 } 108 } 109 110 if ( typeof(curent_gview_long)==='undefined' || curent_gview_long === '' || curent_gview_long === '0') { 111 if( typeof(googlecode_property_vars)!=='undefined' ){ 112 curent_gview_long = googlecode_property_vars.general_longitude; 113 } 114 if( typeof(googlecode_regular_vars)!=='undefined' ){ 115 curent_gview_long = googlecode_regular_vars.general_longitude; 116 } 117 } 118 119 var $mapData = jQuery('#wpestate_full_map_control_data'); 120 121 if ($mapData.attr('data-term_lat') !== undefined && 122 $mapData.attr('data-term_long') !== undefined && 123 $mapData.attr('data-term_zoom') !== undefined) { 124 125 126 127 // Clean the encoded values 128 curent_gview_lat = $mapData.attr('data-term_lat').replace(/"/g, ''); 129 curent_gview_long = $mapData.attr('data-term_long').replace(/"/g, ''); 130 zoom_level = Number($mapData.attr('data-term_zoom').replace(/"/g, '').trim()); 131 var geojsonUrl = $mapData.attr('data-term_geojson') 132 ?.replace(/"/g, '') 133 .replace(/"/g, '') 134 .trim() || ''; 135 136 } else { 137 138 } 139 140 141 142 143 var mapCenter = L.latLng( curent_gview_lat,curent_gview_long ); 144 145 // determine which map container is available and initialize the map 146 var map_id = ''; 147 if (document.getElementById('googleMap')) { 148 map_id = 'googleMap'; 149 } else if (document.getElementById('google_map_prop_list')) { 150 map_id = 'google_map_prop_list'; 151 } else if (document.getElementById('google_map_on_list')) { 152 map_id = 'google_map_on_list'; 153 map_intern = 1; 154 } 155 156 // if no map container is found exit early 157 if (map_id === '') { 158 return; 159 } 160 161 if (map) { 162 map.remove(); 163 } 164 165 166 167 168 169 170 171 172 map = L.map(map_id, { 173 center: mapCenter, 174 zoom: zoom_level, 175 176 }).on('load', function(e) { 177 jQuery('#gmap-loading').remove(); 178 }); 179 180 181 182 183 var tileLayer = wprentals_open_stret_tile_details(); 184 map.addLayer( tileLayer ); 185 186 map.scrollWheelZoom.disable(); 187 if ( Modernizr.mq('only all and (max-width: 768px)') ) { 188 map.dragging.disable(); 189 } 190 // map.touchZoom.disable(); 191 192 if ( geojsonUrl ) { 193 jQuery.getJSON(geojsonUrl, function(data){ 194 L.geoJSON(data).addTo(map); 195 }); 196 } 197 198 199 map.on('popupopen', function(e) { 200 201 lealet_map_move_on_hover=1; 202 203 if( jQuery('#google_map_prop_list_wrapper').length==0 ){ 204 var px = map.project(e.popup._latlng); // find the pixel location on the map where the popup anchor is 205 if( mapfunctions_vars.useprice === 'yes' ){ 206 px.y -= 115;
206 // find the height of the popup container, divide by 2, subtract from the Y axis of marker location 207 }else{ 208 px.y -= 320/2; // find the height of the popup container, divide by 2, subtract from the Y axis of marker location 209 } 210 map.panTo(map.unproject(px),{animate: true}); // pan to new center 211 } 212 213 lealet_map_move_on_hover=1; 214 }); 215 216 217 map.on('load', function(e) { 218 jQuery('#gmap-loading').remove(); 219 }); 220 221 if ( Modernizr.mq('only all and (max-width: 768px)') ) { 222 map.on('dblclick ', function(e) { 223 if (map.dragging.enabled()) { 224 map.dragging.disable(); 225 }else{ 226 map.dragging.enable(); 227 } 228 }); 229 } 230 231 232 markers_cluster=L.markerClusterGroup({ 233 iconCreateFunction: function(cluster) { 234 return L.divIcon({ html: '<div class="leaflet_cluster" style="background-image: url('+images['cloud_pin']+')">' + cluster.getChildCount() + '</div>' }); 235 }, 236 }); 237 238} 239 240 241 242 243 244function wprentals_open_stret_tile_details(){ 245 "use strict"; 246 247 if( mapbase_vars.wp_estate_mapbox_api_key==='' ){ 248 var tileLayer = L.tileLayer( 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { 249 attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' 250 } ); 251 252 }else{ 253 var tileLayer = L.tileLayer( 'https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/256/{z}/{x}/{y}?access_token='+mapbase_vars.wp_estate_mapbox_api_key, { 254 attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', 255 maxZoom: 18, 256 id: 'mapbox.streets', 257 accessToken: 'your.mapbox.access.token' 258 } 259 ); 260 } 261 return tileLayer; 262} 263 264 265 266 267 268 269 270function wprentals_google_start_map(zoom_level){ 271 "use strict"; 272 var mapOptions, styles; 273 274 if (typeof(curent_gview_long)==='undefined' || curent_gview_lat === '' || curent_gview_lat === '0') { 275 if( typeof(googlecode_property_vars)!=='undefined' ){ 276 curent_gview_lat = googlecode_property_vars.general_latitude; 277 } 278 279 if( typeof(googlecode_regular_vars)!=='undefined' ){ 280 curent_gview_lat = googlecode_regular_vars.general_latitude; 281 } 282 } 283 284 if ( typeof(curent_gview_long)==='undefined' || curent_gview_long === '' || curent_gview_long === '0') { 285 if( typeof(googlecode_property_vars)!=='undefined' ){ 286 curent_gview_long = googlecode_property_vars.general_longitude; 287 } 288 if( typeof(googlecode_regular_vars)!=='undefined' ){ 289 curent_gview_long = googlecode_regular_vars.general_longitude; 290 } 291 } 292 293 294 var $mapData = jQuery('#wpestate_full_map_control_data'); 295 296 if ($mapData.attr('data-term_lat') !== undefined && 297 $mapData.attr('data-term_long') !== undefined && 298 $mapData.attr('data-term_zoom') !== undefined) { 299 300 301 302 // Clean the encoded values 303 curent_gview_lat = $mapData.attr('data-term_lat').replace(/"/g, ''); 304 curent_gview_long = $mapData.attr('data-term_long').replace(/"/g, ''); 305 zoom_level = Number($mapData.attr('data-term_zoom').replace(/"/g, '').trim()); 306 var geojsonUrl = $mapData.attr('data-term_geojson') 307 ?.replace(/"/g, '') 308 .replace(/"/g, '') 309 .trim() || ''; 310 311 } else { 312 313 } 314 315 316 317 318 mapOptions = { 319 flat: false, 320 noClear: false, 321 zoom: zoom_level, 322 scrollwheel: false, 323 draggable: true, 324 maxZoom:18, 325 center: new google.maps.LatLng(curent_gview_lat, curent_gview_long), 326 mapTypeId: google.maps.MapTypeId.ROADMAP, 327 streetViewControl: false, 328 mapTypeControlOptions: { 329 mapTypeIds: [google.maps.MapTypeId.ROADMAP] 330 }, 331 disableDefaultUI: true, 332 gestureHandling: 'cooperative' 333 334 }; 335 336 337 338 339 340 341 342 343 if (document.getElementById('googleMap')) { 344 map = new google.maps.Map(document.getElementById('googleMap'), mapOptions); 345 } else if (document.getElementById('google_map_prop_list')) { 346 mapOptions['minZoom']=4; 347 348 map = new google.maps.Map(document.getElementById('google_map_prop_list'), mapOptions); 349 } else if (document.getElementById('google_map_on_list')) { 350 map = new google.maps.Map(document.getElementById('google_map_on_list'), mapOptions); 351 map_intern = 1; 352 } else { 353 return; 354 } 355 bounds_list = new google.maps.LatLngBounds(); 356 google.maps.visualRefresh = true; 357 358 if (mapfunctions_vars.map_style !== '') { 359 styles = JSON.parse(mapfunctions_vars.map_style); 360 map.setOptions({styles: styles}); 361 } 362 363 if(typeof(map_style_shortcode) !=='undefined' && map_style_shortcode !==''){ 364 styles = (map_style_shortcode ); 365 map.setOptions({styles: styles}); 366 } 367 368 google.maps.event.addListener(map, 'tilesloaded', function () { 369 370 jQuery('#gmap-loading').remove(); 371 }); 372 373 374 if ( geojsonUrl ) { 375 map.data.loadGeoJson(geojsonUrl); 376 } 377 378 379 380 google.maps.event.addListener(map, 'tilesloaded', function () { 381 382 jQuery('#gmap-loading').remove(); 383 }); 384 385 386 387 if ( document.getElementById('googleMap') ) { 388 google.maps.event.addDomListener(document.getElementById('googleMap'), 'mousewheel', scrollwhel); 389 google.maps.event.addDomListener(document.getElementById('googleMap'), 'DOMMouseScroll', scrollwhel); 390 } 391 if ( document.getElementById('google_map_prop_list') ) { 392 google.maps.event.addDomListener(document.getElementById('google_map_prop_list'), 'mousewheel', scrollwhel); 393 google.maps.event.addDomListener(document.getElementById('google_map_prop_list'), 'DOMMouseScroll', scrollwhel); 394 } 395 396 function scrollwhel(event) { 397 398 if (map.scrollwheel === true) { 399 event.stopPropagation(); 400 } 401 402 403 } 404 405} 406
407function wprentals_leaflet_fit_to_bounds(){ 408 "use strict"; 409 if ( typeof(bounds_list)!='undefined' && bounds_list.isValid()) { 410 if(mapfunctions_vars.bypass_fit_bounds!=='1'){ 411 wpestate_fit_bounds_leaflet(bounds_list); 412 } 413 }else{ 414 wpestate_fit_bounds_nolsit_leaflet(); 415 } 416 417} 418 419 420 421 422 423 424 425function wprentals_google_fit_to_bounds(){ 426 "use strict"; 427 if (document.getElementById('google_map_prop_list')) { 428 429 if (!bounds_list.isEmpty()) { 430 if(mapfunctions_vars.bypass_fit_bounds!=='1'){ 431 wpestate_fit_bounds(bounds_list); 432 } 433 }else{ 434 wpestate_fit_bounds_nolsit(); 435 } 436 }else if (document.getElementById('googleMap')) { 437 438 if (!bounds_list.isEmpty()) { 439 if(mapfunctions_vars.bypass_fit_bounds!=='1'){ 440 wpestate_fit_bounds(bounds_list); 441 } 442 }else{ 443 wpestate_fit_bounds_nolsit(); 444 } 445 446 } 447} 448 449function wprentals_map_general_spiderfy(){ 450 "use strict"; 451 // avoid errors if map was not created 452 if (typeof map === 'undefined' || !map) { 453 return; 454 } 455 456 if(wprentals_map_type===1){ 457 oms = new OverlappingMarkerSpiderfier(map, {markersWontMove: true, markersWontHide: true, keepSpiderfied: true, legWeight: 3}); 458 setOms(gmarkers); 459 }else if(wprentals_map_type===2){ 460 // no school no job no problem 461 }else if(wprentals_map_type===3){ 462 463 } 464} 465 466 467function wprentals_leaflet_map_pan_move(){ 468 "use strict"; 469 if (googlecode_regular_vars.on_demand_pins==='yes' && mapfunctions_vars.is_tax!=1 && mapfunctions_vars.is_property_list==='1'){ 470 map.on('moveend', function(e) { 471 472 if(wpestate_hover_action_flag===0){ 473 wpestate_ondenamd_map_moved_leaflet(); 474 } 475 476 }); 477 478 } 479} 480 481 482 483 484 485 486 487 488 489function wprentals_google_map_pan_move(){ 490 "use strict"; 491 492 if (googlecode_regular_vars.on_demand_pins==='yes' && mapfunctions_vars.is_tax!=1 && 493 mapfunctions_vars.is_property_list==='1'){ 494 map.addListener('idle', function() { 495 496 if(wpestate_hover_action_flag===0){ 497 wpestate_ondenamd_map_moved(); 498 } 499 }); 500 } 501} 502 503 504 505 506 507function wprentals_google_setMarkers2 (map, locations){ 508 "use strict"; 509 var selected_id = parseInt(jQuery('#gmap_wrapper').attr('data-post_id'), 10); 510 if (isNaN(selected_id)) { 511 selected_id = parseInt(jQuery('#google_map_on_list').attr('data-post_id'), 10); 512 } 513 514 var open_height = parseInt(mapfunctions_vars.open_height, 10); 515 var closed_height = parseInt(mapfunctions_vars.closed_height, 10); 516 517 var width_browser = jQuery(window).width(); 518 519 infobox_width = 700; 520 vertical_pan = -215; 521 if (width_browser < 900) { 522 infobox_width = 500; 523 } 524 if (width_browser < 600) { 525 infobox_width = 400; 526 } 527 if (width_browser < 400) { 528 infobox_width = 200; 529 } 530 531 var i; 532 for (i = 0; i < locations.length; i++) { 533 534 var beach = locations[i]; 535 var id = beach[10]; 536 var lat = beach[1]; 537 var lng = beach[2]; 538 var title = decodeURIComponent(beach[0]); 539 var pin = beach[8]; 540 var counter = beach[3]; 541 var image = decodeURIComponent(beach[4]); 542 var price = decodeURIComponent(beach[5]); 543 var single_first_type = decodeURIComponent(beach[6]); 544 var single_first_action = decodeURIComponent(beach[7]); 545 var link = decodeURIComponent(beach[9]); 546 var city = decodeURIComponent(beach[11]); 547 var area = decodeURIComponent(beach[12]); 548 var cleanprice = beach[13]; 549 var rooms = beach[14]; 550 var baths = beach[15];
551 var size = beach[16]; 552 var single_first_type_name = decodeURIComponent(beach[17]); 553 var single_first_action_name = decodeURIComponent(beach[18]); 554 var status = decodeURIComponent(beach[19]); 555 var pin_price = decodeURIComponent ( beach[20] ); 556 var custom_info = decodeURIComponent ( beach[21] ); 557 558 if (selected_id === id) { 559 found_id = i; 560 } 561 562 if(wprentals_map_type===1){ 563 564 wprentals_createMarker_google(pin_price,infobox_width ,size, i, id, lat, lng, pin, title, counter, image, price, single_first_type, single_first_action, link, city, area, rooms, baths, cleanprice, single_first_type_name, single_first_action_name,status,custom_info); 565 }else if(wprentals_map_type===2){ 566 wprentals_createMarker_leaflet(pin_price,infobox_width ,size, i, id, lat, lng, pin, title, counter, image, price, single_first_type, single_first_action, link, city, area, rooms, baths, cleanprice, single_first_type_name, single_first_action_name,status,custom_info); 567 568 }else if(wprentals_map_type===3){ 569 570 } 571 572 } 573 574} 575 576function wprentals_createMarker_google(pin_price,infobox_width, size, i, id, lat, lng, pin, title, counter, image, price, single_first_type, single_first_action, link, city, area, rooms, baths, cleanprice, single_first_type_name, single_first_action_name,status,custom_info) { 577 "use strict"; 578 579 var marker, myLatLng; 580 var Titlex = jQuery('<textarea />').html(title).text(); 581 var infobox_class = ""; 582 var poss = 0; 583 var boxText = document.createElement("div"); 584 var myOptions = { 585 content: boxText, 586 disableAutoPan: true, 587 maxWidth: infobox_width, 588 boxClass: "mybox", 589 zIndex: null, 590 closeBoxMargin: "-13px 0px 0px 0px", 591 closeBoxURL: "", 592 infoBoxClearance: new google.maps.Size(1, 1), 593 isHidden: false, 594 pane: "floatPane", 595 enableEventPropagation: false 596 }; 597 infoBox = new InfoBox(myOptions); 598 599 600 myLatLng = new google.maps.LatLng(lat, lng); 601 if(mapfunctions_vars.useprice === 'yes' && mapfunctions_vars.hidden_map ){ 602 infobox_class=" pin_price_info "; 603 var myLatlng = new google.maps.LatLng(lat,lng); 604 marker= new WpstateMarker( 605 area, 606 city, 607 pin_price, 608 poss, 609 myLatlng, 610 map, 611 Titlex, 612 counter, 613 image, 614 id, 615 price, 616 single_first_type, 617 single_first_action, 618 link, 619 i, 620 rooms, 621 baths, 622 cleanprice, 623 size, 624 single_first_type_name, 625 single_first_action_name, 626 pin, 627 custom_info 628 629 ); 630 631 }else{ 632 infobox_class=" classic_info "; 633 marker = new google.maps.Marker({ 634 position: myLatLng, 635 map: map, 636 icon: custompin(pin), 637 custompin: pin, 638 shape: shape, 639 title: title, 640 zIndex: counter, 641 image: image, 642 idul: id, 643 price: price, 644 category: single_first_type, 645 action: single_first_action, 646 link: link, 647 city: city, 648 area: area, 649 infoWindowIndex: i, 650 rooms: rooms, 651 guest_no: baths, 652 cleanprice: cleanprice, 653 size: size, 654 category_name: single_first_type_name, 655 action_name: single_first_action_name, 656 status:status, 657 custom_info:custom_info 658 }); 659 660 } 661 662 gmarkers.push(marker); 663 664 665 if (typeof (bounds_list) !== "undefined") { 666 667 bounds_list.extend(marker.getPosition()); 668 } 669 670 671 google.maps.event.addListener(marker, 'click', function (event) { 672 673 674 var title, info_image, category, action, category_name, action_name, in_type, infoguest, inforooms, vertical_off, status_html,status; 675 wpestate_new_open_close_map(1); 676 external_action_ondemand=1; 677 678 if (this.image === '') { 679 info_image = mapfunctions_vars.path + '/idxdefault.jpg'; 680 } else { 681 info_image = this.image; 682 } 683 684 685 686 687 if ( typeof(this.status)!='undefined'){ 688 if( this.status.indexOf('%')!==-1 ){ 689 status = this.status; 690 }else{ 691 status = decodeURIComponent(this.status.replace(/-/g, ' ')); 692 } 693 }else{ 694 status=''; 695 } 696 697 698 699 category = decodeURIComponent(this.category.replace(/-/g, ' ')); 700 action = decodeURIComponent(this.action.replace(/-/g, ' ')); 701 category_name = decodeURIComponent(this.category_name.replace(/-/g, ' ')); 702 action_name = decodeURIComponent(this.action_name.replace(/-/g, ' ')); 703 704 status_html=wpestate_display_status(status); 705 706 707 in_type = mapfunctions_vars.in_text; 708 if (category === '' || action === '') { 709 in_type = " "; 710 } 711 in_type = " / "; 712 713 if (this.guest_no !== '' && this.guest_no !== '0' && this.guest_no !== 0 ) { 714 infoguest = '<span id="infoguest">' + this.guest_no + '</span>'; 715 } else { 716 infoguest = ''; 717 } 718 719 if (this.rooms !== '') { 720 inforooms = '<span id="inforoom">' + this.rooms + '</span>'; 721 } else { 722 inforooms = ''; 723 } 724 725 title = this.title.toString(); 726 727 728 729 730 if( this.custom_info!=='undefined'){ 731 var custom_array=this.custom_info.split(','); 732 inforooms = '<span id="inforoom" class="custom_infobox_icon"><i class="' + custom_array[0] + '"></i>' + custom_array[1] + '</span>'; 733 infoguest = '<span id="infoguest" class="custom_infobox_icon"><i class="' + custom_array[2] + '"></i>' + custom_array[3] + '</span>'; 734 735 } 736 737 infoBox.setContent('<div class="info_details '+infobox_class+' "><span id="infocloser" onClick=\'javascript:infoBox.close();\' ></span>'+status_html+'<a href="' + this.link + '"><div class="infogradient"></div><div class="infoimage" style="background-image:url(' + info_image + ')" ></div></a><a href="' + this.link + '" id="infobox_title"> ' + title + '</a><div class="prop_detailsx">' + category_name + " " + in_type + " " + action_name + '</div><div class="infodetails">' + infoguest + inforooms + '</div><div class="prop_pricex">' + this.price + '</div></div>'); 738 739 if( mapfunctions_vars.hidden_map ){ 740 infoBox.open(map, this); 741 } 742 743 map.setCenter(this.position); 744 745 746 google.maps.event.addListenerOnce(map, 'tilesloaded', function() { 747 if( !mapfunctions_vars.hidden_map ){ 748 }else{ 749 switch (infobox_width) { 750 case 700: 751 752 if (!document.getElementById('google_map_on_list')) { 753 if (mapfunctions_vars.listing_map === 'top') { 754 if( document.getElementById('google_map_prop_list') ){ 755 map.panBy(0, -100); 756 757 }else{ 758 759 map.panBy(100, -100); 760 } 761 } else { 762 map.panBy(10, -110); 763 } 764 } else { 765 if( mapfunctions_vars.hidden_map ){ 766 map.panBy(0, -160); 767 } 768 } 769 vertical_off = 0; 770 break; 771 case 500: 772 773 if( document.getElementById('google_map_prop_list') ){ 774 map.panBy(50, -120); 775 }else{ 776 map.panBy(50, -150); 777 } 778 break; 779 case 400: 780 781 if( document.getElementById('google_map_prop_list') ){ 782 map.panBy(100, -220); 783 }else{ 784 map.panBy(0, -150); 785 } 786 break; 787 case 200: 788 789 map.panBy(20, -170); 790 break; 791 } 792 } 793 }); 794 795 796 797 798 if (control_vars.show_adv_search_map_close === 'no') { 799 $('.search_wrapper').addClass('adv1_close'); 800 adv_search_click(); 801 } 802 wpestate_close_adv_search(); 803 });/////////////////////////////////// end event listener 804 805 if (mapfunctions_vars.generated_pins !== '0') { 806 if(map_is_pan===0){ 807 808 wpestate_pan_to_last_pin(myLatLng); 809 } 810 map_is_pan=1; 811 } 812} 813 814function wprentals_createMarker_leaflet(pin_price,infobox_width, size, i, id, lat, lng, pin, title, counter, image, price, single_first_type, single_first_action, link, city, area, rooms, guest_no, cleanprice, single_first_type_name, single_first_action_name,status,custom_info) { 815 "use strict"; 816 817 var infoboxWrapper = document.createElement( "div" ); 818 infoboxWrapper.className = 'leafinfobox-wrapper'; 819 var infobox = ""; 820 821 var infobox_class=" classic_info "; 822 if( mapfunctions_vars.useprice === 'yes' ){ 823 infobox_class =' openstreet_map_price_infobox '; 824 } 825 826 if ( typeof(status)!='undefined'){ 827 if( status.indexOf('%')!==-1 ){ 828 829 }else{ 830 status = decodeURIComponent(status.replace(/-/g, ' ')); 831 } 832 }else{ 833 status=''; 834 } 835 836 837 var status_html=wpestate_display_status(status); 838 839 840 var info_image=''; 841 if (image === '') { 842 info_image = mapfunctions_vars.path + '/idxdefault.jpg'; 843 } else { 844 info_image = image; 845 } 846 847 var category = decodeURIComponent(single_first_type.replace(/-/g, ' ')); 848 var action = decodeURIComponent(single_first_action.replace(/-/g, ' ')); 849 var category_name = decodeURIComponent(single_first_type_name.replace(/-/g, ' ')); 850 var action_name = decodeURIComponent(single_first_action_name.replace(/-/g, ' ')); 851 852 var in_type = mapfunctions_vars.in_text; 853 if (category === '' || action === '') { 854 in_type = " "; 855 } 856 in_type = " / "; 857 var infoguest,inforooms; 858 859 if (guest_no !== '') { 860 infoguest = '<span id="infoguest">' + guest_no + '</span>'; 861 } else { 862 infoguest = ''; 863 } 864 865 if (rooms !== '') { 866 inforooms = '<span id="inforoom">' + rooms + '</span>'; 867 } else { 868 inforooms = ''; 869 } 870 871 title = title.toString(); 872 873 if( custom_info!=='undefined'){ 874 var custom_array=custom_info.split(','); 875 inforooms = '<span id="inforoom" class="custom_infobox_icon"><i class="' + custom_array[0] + '"></i>' + custom_array[1] + '</span>'; 876 infoguest = '<span id="infoguest" class="custom_infobox_icon"><i class="' + custom_array[2] + '"></i>' + custom_array[3] + '</span>'; 877 } 878 infobox += '<div class="info_details '+infobox_class+' "><a id="infocloser" onClick=\'javascript:jQuery(".leaflet-popup-close-button")[0].click();\' ></a>'+status_html+'<a href="' + link + '"><div class="infogradient"></div><div class="infoimage" style="background-image:url(' + info_image + ')" ></div></a><a href="' + link + '" id="infobox_title"> ' + title + '</a><div class="prop_detailsx">' + category_name + " " + in_type + " " + action_name + '</div><div class="infodetails">' + infoguest + inforooms + '</div><div class="prop_pricex">' + price + '</div></div>'; 879 880 var markerOptions = { 881 riseOnHover: true 882 }; 883 884 var markerCenter = L.latLng( lat, lng ); 885 var propertyMarker = ''; 886 887 888 if( !mapfunctions_vars.hidden_map ){ 889 // Approximate-location circle: stroke and fill follow the theme main color 890 propertyMarker = L.circle(markerCenter, { 891 color: mapfunctions_vars.main_color, 892 fillColor: mapfunctions_vars.main_color, 893 fillOpacity: 0.4, 894 strokeWeight: 0.4, 895 radius: 120 896 897 898 }); 899 900 }else{ 901 902 903 if( mapfunctions_vars.useprice === 'yes' ){ 904 var price_pin_class= 'wpestate_marker openstreet_price_marker '+wpestate_makeSafeForCSS(single_first_type_name.trim() )+' '+wpestate_makeSafeForCSS(single_first_action_name.trim()); 905 906 var pin_price_marker = '<div class="'+price_pin_class+'">'; 907 if (typeof(price) !== 'undefined') { 908 if( mapfunctions_vars.use_price_pins_full_price==='no'){ 909 pin_price_marker +='<div class="interior_pin_price">'+pin_price+'</div>'; 910 }else{ 911 pin_price_marker +='<div class="interior_pin_price">'+price+'</div>'; 912 } 913 } 914 pin_price_marker += '</div>'; 915 916 var myIcon = L.divIcon({ 917 className:'someclass', 918 iconSize: new L.Point(0, 0), 919 html: pin_price_marker 920 }); 921 propertyMarker = L.marker( markerCenter, {icon: myIcon} ); 922 923 }else{ 924 var markerImage = { 925 iconUrl: wprentals_custompin_leaflet(pin), 926 iconSize: [44, 50], 927 iconAnchor: [20, 50],
928 popupAnchor: [1, -50] 929 }; 930 markerOptions.icon = L.icon( markerImage ); 931 propertyMarker = L.marker( markerCenter, markerOptions ); 932 } 933 934 935 } 936 937 938 propertyMarker.idul = id; 939 propertyMarker.pin = pin; 940 941 if (mapfunctions_vars.user_cluster === 'yes') { 942 markers_cluster.addLayer(propertyMarker); 943 }else{ 944 propertyMarker.addTo( map ); 945 } 946 947 gmarkers.push(propertyMarker); 948 949 if (typeof (bounds_list) !== "undefined") { 950 bounds_list.extend(propertyMarker.getLatLng()); 951 }else{ 952 bounds_list = L.latLngBounds( propertyMarker.getLatLng(),propertyMarker.getLatLng() ); 953 } 954 955 infoboxWrapper.innerHTML = infobox; 956 propertyMarker.bindPopup( infobox ); 957 958 959 if (mapfunctions_vars.generated_pins !== '0') { 960 if(map_is_pan===0){ 961 wpestate_pan_to_last_pin(markerCenter); 962 } 963 map_is_pan=1; 964 } 965 966 967 968} 969 970function wprentals_custompinchild_leaflet(image) { 971 "use strict"; 972 var custom_img; 973 var extension=''; 974 var ratio = jQuery(window).dense('devicePixelRatio'); 975 976 if(ratio>1){ 977 extension='_2x'; 978 } 979 980 if (images['userpin'] === '') { 981 custom_img = mapfunctions_vars.path + '/' + 'userpin' +extension+ '.png'; 982 } else { 983 custom_img = images['userpin']; 984 if(ratio>1){ 985 custom_img=custom_img.replace(".png","_2x.png"); 986 } 987 } 988 989 990 991 return custom_img; 992} 993 994function wprentals_custompin_leaflet(image) { 995 "use strict"; 996 997 if( mapfunctions_vars.useprice === 'yes' ){ 998 return mapfunctions_vars.path + '/pixel.png'; 999 } 1000 1001 var custom_img = ''; 1002 var extension = ''; 1003 var ratio = jQuery(window).dense('devicePixelRatio'); 1004 1005 if(ratio>1){ 1006 extension='_2x'; 1007 } 1008 1009 if(mapfunctions_vars.use_single_image_pin==='no'){ 1010 if (image !== '') { 1011 if (images[image] === '') { 1012 custom_img = mapfunctions_vars.path + '/' + image + extension + '.png'; 1013 } else { 1014 custom_img = images[image]; 1015 if(ratio>1){ 1016 custom_img=wpestate_get_custom_retina_pin(custom_img); 1017 } 1018 } 1019 } else { 1020 custom_img = images['single_pin']; 1021 } 1022 }else{ 1023 if(ratio>1){ 1024 custom_img= wpestate_get_custom_retina_pin( images['single_pin'] ); 1025 }else{ 1026 custom_img= images['single_pin']; 1027 } 1028 } 1029 1030 return custom_img; 1031} 1032 1033 1034 1035 1036 1037 1038function wprentals_map_resize(){ 1039 "use strict"; 1040 if(wprentals_map_type===1){ 1041 google.maps.event.trigger(map, "resize"); 1042 }else if(wprentals_map_type===2){ 1043 map.invalidateSize(); 1044 }else if(wprentals_map_type===3){ 1045 1046 } 1047} 1048 1049 1050 1051 1052 1053wprentals_autocomplete_mapbox(); 1054 1055/* 1056* 1057* Autocomplete for OpenStreetMap 1058* 1059* 1060*/ 1061function wprentals_openstreet__code_address_map_call(item_id){ 1062 1063 var featuretype='settlement'; 1064 if(item_id==='property_address'){ 1065 featuretype=''; 1066 } 1067 jQuery('#'+item_id).autocomplete( { 1068 source: function ( request, response ) { 1069 1070 var search_parameters={ 1071 format: 'json', 1072 featuretype:featuretype, 1073 q: request.term,//was q 1074 addressdetails:'1', 1075 }; 1076 1077 if(control_vars.limit_country==='yes' && control_vars.limit_country_select!='' ){ 1078 search_parameters.countrycodes=control_vars.limit_country_select; 1079 } 1080 1081 1082 jQuery.get( 'https://nominatim.openstreetmap.org/search?accept-language=en', search_parameters, function( result ) { 1083 if ( !result.length ) { 1084 response( [ { 1085 value: '', 1086 label: 'there are no results' 1087 } ] ); 1088 return; 1089 } 1090 response( result.map( function ( place ) { 1091 1092 var return_obj= { 1093 label: place.display_name, 1094 latitude: place.lat, 1095 longitude: place.lon, 1096 value: place.display_name, 1097 }; 1098 1099 1100 if(typeof(place.address)!='undefined'){ 1101 return_obj.county=place.address.county; 1102 } 1103 1104 if (typeof(place.address) !== 'undefined') { 1105 // OpenStreetMap may return the locality under different keys 1106 // depending on the size of the settlement. Fallback to other 1107 // possible fields when "city" is missing so we always get a 1108 // meaningful value for the property city. 1109 var cityCandidate = place.address.city || 1110 place.address.town || 1111 place.address.village || 1112 place.address.municipality || 1113 place.address.county; 1114 1115 // As a final safety, take the first segment of the label 1116 // when no dedicated locality field is available. 1117 // if (!cityCandidate && typeof place.display_name !== 'undefined') { 1118 // cityCandidate = place.display_name.split(',')[0]; 1119 // } 1120 1121 return_obj.city = cityCandidate; 1122 1123 } 1124 1125 if(typeof(place.address)!='undefined'){ 1126 return_obj.state=place.address.state; 1127 } 1128 1129 if(typeof(place.address)!='undefined'){ 1130 return_obj.country=place.address.country; 1131 } 1132 1133 if(typeof(place.address)!='undefined'){ 1134 return_obj.zip=place.address.postcode; 1135 } 1136 1137 return return_obj 1138 1139 } ) ); 1140 }, 'json' ); 1141 }, 1142 select: function ( event, ui ) { 1143 1144 var admin_area = ''; 1145 1146 jQuery('#property_city').val(ui.item.city); 1147 jQuery('#property_country').val(ui.item.country); 1148 jQuery('#property_admin_area').val( ui.item.label); 1149 1150 1151 if(item_id==='property_address'){ 1152 wprentals_submit_agolia_codeAddress( ui.item.latitude, ui.item.longitude); 1153 } 1154 1155 if(item_id==='geolocation_search'){ 1156 jQuery("#geolocation_lat").val(ui.item.latitude); 1157 jQuery("#geolocation_long").val(ui.item.longitude); 1158 1159 wpestate_start_filtering_ajax_map(1); 1160 } 1161 1162 1163 1164 1165 1166 wprentals_fillInAddress_filter_leaflet(ui.item,item_id); 1167 1168 1169 if(item_id==='search_locationhalf'){ 1170 wpestate_start_filtering_ajax_map(1); 1171 } 1172 1173 1174 } 1175 } ); 1176 1177 1178} 1179 1180 1181 1182function wprentals_autocomplete_mapbox(){ 1183 "use strict"; 1184 1185 if( parseInt(mapbase_vars.wprentals_places_type) == 1 ){ 1186 return; 1187 } 1188 1189 1190 if (document.getElementById('property_city_front')) { 1191 1192 if( parseInt( mapbase_vars.wprentals_places_type)==3 ){ 1193 wprentals_openstreet__code_address_map_call('property_city_front'); 1194 }else if( parseInt( mapbase_vars.wprentals_places_type)==2 ){ 1195 1196 var placesAutocomplete = places({ 1197 appId: mapbase_vars.wp_estate_algolia_app_id, 1198 apiKey: mapbase_vars.wp_estate_algolia_api_key, 1199 type: 'city', 1200 language: 'en', 1201 templates: { 1202 value: function(suggestion) { 1203 return suggestion.name; 1204 } 1205 }, 1206 container: document.querySelector('#property_city_front') 1207 }); 1208 1209 placesAutocomplete.on('change', function(e) { 1210 wprentals_agolia_fillInAddress_city(e); 1211 }); 1212 1213 } 1214 } 1215 1216 1217 // agolia on submit 1218 if (document.getElementById('property_address')) { 1219 1220 var address, full_addr, country, city, infowindow; 1221 address = document.getElementById('property_address').value; 1222 city = jQuery("#property_city_submit").val(); 1223 full_addr = address + ',' + city; 1224 country = document.getElementById('property_country').value; 1225 if (country) { 1226 full_addr = full_addr + ',' + country; 1227 } 1228 1229 if( parseInt( mapbase_vars.wprentals_places_type)==3 ){ 1230 wprentals_openstreet__code_address_map_call('property_address'); 1231 }else if( parseInt( mapbase_vars.wprentals_places_type)==2 ){ 1232 1233 var placesAutocomplete = places({ 1234 appId: mapbase_vars.wp_estate_algolia_app_id, 1235 apiKey: mapbase_vars.wp_estate_algolia_api_key, 1236 type: 'address', 1237 language: 'en', 1238 1239 templates: { 1240 value: function(suggestion) { 1241 return suggestion.name; 1242 } 1243 }, 1244 container: document.querySelector('#property_address') 1245 }); 1246 1247 placesAutocomplete.on('change', function(place) { 1248 wprentals_submit_agolia_codeAddress(place.suggestion.latlng.lat,place.suggestion.latlng.lng); 1249 }); 1250 1251 } 1252 } 1253 1254 //agoliaa on geolocation half 1255 1256 if (document.getElementById('geolocation_search')) { 1257 if( parseInt( mapbase_vars.wprentals_places_type)==2 ){ 1258 var placesAutocomplete = places({ 1259 appId: mapbase_vars.wp_estate_algolia_app_id, 1260 apiKey: mapbase_vars.wp_estate_algolia_api_key, 1261 language: 'en', 1262 templates: { 1263 value: function(suggestion) { 1264 return suggestion.name; 1265 } 1266 }, 1267 container: document.querySelector('#geolocation_search') 1268 }); 1269 initial_geolocation_circle_flag=0; 1270 placesAutocomplete.on('change', function(place) { 1271 initial_geolocation_circle_flag=0; 1272 jQuery("#geolocation_lat").val(place.suggestion.latlng.lat); 1273 jQuery("#geolocation_long").val(place.suggestion.latlng.lng); 1274 1275 wpestate_start_filtering_ajax_map(1); 1276 }); 1277 1278 }else if( parseInt( mapbase_vars.wprentals_places_type)==3 ){ 1279 initial_geolocation_circle_flag=0; 1280 wprentals_openstreet__code_address_map_call('geolocation_search'); 1281 } 1282 1283 1284 1285 } 1286 1287 var search_fields = ['search_location', 'search_locationshortcode', 'search_locationmobile','search_locationsidebar','search_locationhalf']; 1288 1289 search_fields.forEach(function(element) { 1290 1291 if (document.getElementById(element) && document.getElementById(element).getAttribute("type") == "text" ) { 1292 if( parseInt( mapbase_vars.wprentals_places_type)==2 ){ 1293 1294 var placesAutocomplete = places({ 1295 appId: mapbase_vars.wp_estate_algolia_app_id, 1296 apiKey: mapbase_vars.wp_estate_algolia_api_key, 1297 type: 'city', 1298 language: 'en', 1299 1300 templates: { 1301 value: function(suggestion) { 1302 return suggestion.name; 1303 } 1304 }, 1305 container: document.querySelector('#'+element) 1306 }); 1307 1308 placesAutocomplete.on('change', function(place) { 1309 wprentals_fillInAddress_filter_leaflet(place,element); 1310 }); 1311 1312 }else if( parseInt( mapbase_vars.wprentals_places_type)==3 ){ 1313 wprentals_openstreet__code_address_map_call(element); 1314 } 1315 } 1316 }); 1317 1318 1319 1320 1321 } 1322 1323 1324 1325function wprentals_fillInAddress_filter_leaflet(place,element){ 1326 "use strict"; 1327 var i, addressType, val, have_city,admin_area,property_country,property_area,property_city; 1328 have_city = 0; 1329 admin_area = ''; 1330 1331 var extension=''; 1332 1333 if(element=='search_locationshortcode'){ 1334 extension='shortcode'; 1335 }else if(element=='search_locationmobile'){ 1336 extension='mobile'; 1337 }else if(element=='search_locationsidebar'){ 1338 extension='sidebar'; 1339 }else if(element=='search_locationhalf'){ 1340 extension='half' 1341 } 1342 1343 if( typeof(place.label)!=='undefined' ){ 1344 admin_area=admin_area+place.label; 1345 } 1346 1347 1348 1349 var admin_area_lower = (typeof admin_area === 'string') ? admin_area.toLowerCase() : admin_area; 1350 jQuery('#property_admin_area,#property_admin_areasidebar,#property_admin_areashortcode,#property_admin_areamobile').val(admin_area_lower); 1351 1352 1353 1354 1355 if( typeof(place.country)!=='undefined' ){ 1356 property_country = (typeof place.country === 'string') ? place.country.toLowerCase() : place.country; 1357 1358 jQuery('#advanced_country'+extension).attr('data-value', property_country); 1359 jQuery('#advanced_country'+extension).val(property_country); 1360 jQuery('#search_location_country'+extension).val(property_country); 1361 1362 } 1363 1364 1365 if( typeof(place.city)!=='undefined' ){ 1366 property_city=place.city; 1367 jQuery('#advanced_city'+extension).attr('data-value', property_city); 1368 jQuery('#advanced_city'+extension).val(property_city); 1369 jQuery('#search_location_city'+extension).val(property_city); 1370 } 1371 1372 1373 if(jQuery('#advanced_search_map_list').length>0){ 1374 1375 1376 if( jQuery("#geolocation_search").length > 0 ){ 1377 var place_lat = jQuery('#geolocation_lat').val(); 1378 var place_lng = jQuery('#geolocation_long').val(); 1379 1380 1381 if(place_lat!=='' && place_lng!==''){ 1382 initial_geolocation_circle_flag=1; 1383 wpestate_geolocation_marker(place_lat,place_lng); 1384 if (googlecode_regular_vars.on_demand_pins==='no'){ 1385 initial_geolocation_circle_flag=0; 1386 } 1387 1388 } 1389 } 1390 } 1391 1392 1393 1394 var is_google_map = parseFloat(jQuery('#isgooglemap').attr('data-isgooglemap'), 10); 1395 if (is_google_map === 1) { 1396 var guest_val=jQuery(this).attr('data-value'); 1397 } 1398} 1399 1400 1401 1402function wprentals_fillInAddress_filter_leaflet_old(place,element){ 1403 "use strict"; 1404 var i, addressType, val, have_city,admin_area,property_country,property_area,property_city; 1405 have_city = 0; 1406 admin_area = ''; 1407 1408 var extension=''; 1409 1410 if(element=='search_locationshortcode'){ 1411 extension='shortcode'; 1412 }else if(element=='search_locationmobile'){ 1413 extension='mobile'; 1414 }else if(element=='search_locationsidebar'){ 1415 extension='sidebar'; 1416 }else if(element=='search_locationhalf'){ 1417 extension='half' 1418 } 1419 1420 if( typeof(place.suggestion.administrative)!=='undefined' ){ 1421 admin_area=admin_area+place.suggestion.administrative; 1422 } 1423 1424 if( typeof(place.suggestion.county)!=='undefined' ){ 1425
1425 admin_area=admin_area+', '+place.suggestion.county; 1426 } 1427 1428 var admin_area_lower = (typeof admin_area === 'string') ? admin_area.toLowerCase() : admin_area; 1429 jQuery('#property_admin_area,#property_admin_areasidebar,#property_admin_areashortcode,#property_admin_areamobile').val(admin_area_lower); 1430 1431 1432 1433 1434 if( typeof(place.suggestion.country)!=='undefined' ){ 1435 property_country = (typeof place.suggestion.country === 'string') ? place.suggestion.country.toLowerCase() : place.suggestion.country; 1436 1437 jQuery('#advanced_country'+extension).attr('data-value', property_country); 1438 jQuery('#advanced_country'+extension).val(property_country); 1439 jQuery('#search_location_country'+extension).val(property_country); 1440 1441 } 1442 1443 1444 if(place.suggestion.type=='city' ){ 1445 property_city=place.suggestion.value; 1446 jQuery('#advanced_city'+extension).attr('data-value', property_city); 1447 jQuery('#advanced_city'+extension).val(property_city); 1448 jQuery('#search_location_city'+extension).val(property_city); 1449 } 1450 if(place.suggestion.type=='address' ){ 1451 property_area=place.suggestion.address; 1452 jQuery('#advanced_area'+extension).attr('data-value', property_area); 1453 jQuery('#advanced_area'+extension).val(property_area); 1454 jQuery('#search_location_area'+extension).val(property_area); 1455 } 1456 1457 1458 1459 1460 if(jQuery('#advanced_search_map_list').length>0){ 1461 wpestate_start_filtering_ajax_map(1); 1462 } 1463 1464 1465 1466 var is_google_map = parseFloat(jQuery('#isgooglemap').attr('data-isgooglemap'), 10); 1467 if (is_google_map === 1) { 1468 var guest_val=jQuery(this).attr('data-value'); 1469 } 1470} 1471 1472 1473 1474 1475 1476function wprentals_agolia_fillInAddress_city(place) { 1477 "use strict"; 1478 var admin_area = ''; 1479 var property_city = ''; 1480 var property_country= ''; 1481 1482 if( typeof(place.suggestion.administrative)!=='undefined' ){ 1483 admin_area=admin_area+place.suggestion.administrative; 1484 } 1485 1486 if( typeof(place.suggestion.county)!=='undefined' ){ 1487 admin_area=admin_area+', '+place.suggestion.county; 1488 } 1489 1490 if( typeof(place.suggestion.country)!=='undefined' ){ 1491 property_country=place.suggestion.country; 1492 } 1493 1494 if( typeof(place.suggestion.value)!=='undefined' ){ 1495 property_city=place.suggestion.value; 1496 } 1497 1498 1499 jQuery('#property_city').val(property_city); 1500 jQuery('#property_country').val(property_country); 1501 jQuery('#property_admin_area').val( property_city+", "+admin_area); 1502 1503} 1504 1505 1506function wprentals_initialize_map_submit_leaflet(){ 1507 1508 "use strict"; 1509 var listing_lat = jQuery('#property_latitude').val(); 1510 var listing_lon = jQuery('#property_longitude').val(); 1511 1512 if (listing_lat === '' || listing_lat === 0 || listing_lat === '0') { 1513 listing_lat = google_map_submit_vars.general_latitude; 1514 } 1515 1516 if (listing_lon === '' || listing_lon === 0 || listing_lon === '0') { 1517 listing_lon = google_map_submit_vars.general_longitude; 1518 } 1519 1520 var mapCenter = L.latLng( listing_lat,listing_lon ); 1521 1522 1523 if (document.getElementById('googleMapsubmit')) { 1524 map = L.map( 'googleMapsubmit',{ 1525 center: mapCenter, 1526 zoom: 17 1527 }).on('load', function(e) { 1528 1529 }); 1530 // map_intern = 1; 1531 1532 1533 1534 var tileLayer = wprentals_open_stret_tile_details(); 1535 1536 map.addLayer( tileLayer ); 1537 map.on('click', function(e){ 1538 1539 map.removeLayer( propertyMarker_submit ); 1540 var markerCenter = L.latLng( e.latlng); 1541 propertyMarker_submit = L.marker(e.latlng).addTo(map); 1542 propertyMarker_submit.bindPopup('<div class="submit_leaflet_admin">Latitude: ' + e.latlng.lat + ' Longitude: ' + e.latlng.lng+'</div>').openPopup(); 1543 document.getElementById("property_latitude").value = e.latlng.lat ; 1544 document.getElementById("property_longitude").value = e.latlng.lng; 1545 }); 1546 1547 1548 var markerCenter = L.latLng( listing_lat,listing_lon ); 1549 propertyMarker_submit = L.marker( markerCenter ).addTo(map); 1550 propertyMarker_submit.bindPopup('<div class="submit_leaflet_admin">Latitude: ' + listing_lat + ' Longitude: ' + listing_lon+'</div>').openPopup(); 1551 } 1552} 1553 1554 1555function wprentals_submit_agolia_codeAddress(listing_lat,listing_lon){ 1556 "use strict"; 1557 if( parseInt(mapbase_vars.wprentals_map_type) ==1 ){ 1558 wprentals_submit_set_postion(listing_lat,listing_lon); 1559 }else if( parseInt(mapbase_vars.wprentals_map_type) ==2 ){ 1560 map.removeLayer( propertyMarker_submit ); 1561 var markerCenter = L.latLng( listing_lat,listing_lon ); 1562 propertyMarker_submit = L.marker( markerCenter ).addTo(map);
1563 map.setView(markerCenter, 15); 1564 propertyMarker_submit.bindPopup('<div class="submit_leaflet_admin">Latitude: ' + listing_lat + ' Longitude: ' + listing_lon+'</div>').openPopup(); 1565 document.getElementById("property_latitude").value = listing_lat ; 1566 document.getElementById("property_longitude").value = listing_lon; 1567 } 1568 1569 1570 1571} 1572 1573 1574 1575function wprentals_submit_set_postion(listing_lat,listing_long){ 1576 "use strict"; 1577 wpestate_removeMarkers(); 1578 var myLatLng = new google.maps.LatLng( listing_lat, listing_long); 1579 map.setCenter(myLatLng); 1580 var marker = new google.maps.Marker({ 1581 map: map, 1582 position: myLatLng 1583 }); 1584 1585 gmarkers.push(marker); 1586 var infowindow = new google.maps.InfoWindow({ 1587 content: 'Latitude: ' + listing_lat + '<br>Longitude: ' + listing_long 1588 }); 1589 1590 infowindow.open(map,marker); 1591 document.getElementById("property_latitude").value = listing_lat ; 1592 document.getElementById("property_longitude").value = listing_long; 1593 1594} 1595 1596 1597 1598function wpestate_display_status(status){ 1599 var status_html=''; 1600 1601 if (status!=='normal' && status!==''){ 1602 var status_array = status.split(","); 1603 for (var i = 0; i < status_array.length; i++) { 1604 status_html=status_html+'<div class="property_status status_'+status_array[i]+'">'+status_array[i]+'</div>'; 1605 } 1606 } 1607 1608 return status_html='<div class="property_status_wrapper_infobox">'+status_html+'</div>'; 1609 1610}
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.