PageSourceSearch

https://thailandproperty.co/js2/maps.js

js thailandproperty.co collected 2026-10-10 01:38:23 UTC 22,826 bytes, 679 lines download raw bytes

1var properties = {
2    "data": [
3        {
4            "id": 1,
5            "title": "Beautiful single home",
6            "price": 2505.11,
7            "listing_for": "Sale",
8            'author': 'Jhon Doe',
9            'date': '5 days ago',
10            "is_featured": true,
11            "latitude": 51.541599,
12            "longitude": -0.112588,
13            "address": "123 Kathal St. Tampa City, ",
14            "area": 2123,
15            "room": 4,
16            "bathroom": 3,
17            "balcony": 3,
18            "lounge": 1,
19            "garage": 1,
20            "image": "http://placehold.it/268x220",
21            "type_icon": "img/building.png",
22            "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "
23        },
24        {
25            "id": 2,
26            "title": "Modern Family Home",
27            "price": 2505.11,
28            "listing_for": "Rent",
29            'author': 'Jhon Doe',
30            'date': '5 days ago',
31            "is_featured": false,
32            "latitude": 51.538395,
33            "longitude": -0.097418,
34            "address": "123 Kathal St. Tampa City, ",
35            "area": 2123,
36            "room": 4,
37            "bathroom": 3,
38            "balcony": 3,
39            "lounge": 1,
40            "garage": 1,
41            "image": "http://placehold.it/268x220",
42            "type_icon": "img/building.png",
43            "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "
44        },
45        {
46            "id": 3,
47            "title": "Sweet Family home",
48            "price": 2505.11,
49            "listing_for": "Rent",
50            'author': 'Jhon Doe',
51            'date': '5 days ago',
52            "is_featured": true,
53            "latitude": 51.539212,
54            "longitude": -0.118403,
55            "address": "123 Kathal St. Tampa City, ",
56            "area": 2123,
57            "room": 4,
58            "bathroom": 3,
59            "balcony": 3,
60            "lounge": 1,
61            "garage": 1,
62            "image": "http://placehold.it/268x220",
63            "type_icon": "img/building.png",
64            "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "
65        },
66        {
67            "id": 4,
68            "title": "Park avenue",
69            "price": 2505.11,
70            "listing_for": "Sale",
71            'author': 'Jhon Doe',
72            'date': '5 days ago',
73            "is_featured": true,
74            "latitude": 51.522340,
75            "longitude": -0.037894,
76            "address": "123 Kathal St. Tampa City, ",
77            "area": 2123,
78            "room": 4,
79            "bathroom": 3,
80            "balcony": 3,
81            "lounge": 1,
82            "garage": 1,
83            "image": "http://placehold.it/268x220",
84            "type_icon": "img/building.png",
85            "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "
86        },
87        {
88            "id": 5,
89            "title": "Masons Villas",
90            "price": 2505.11,
91            "listing_for": "Rent",
92            'author': 'Jhon Doe',
93            'date': '5 days ago',
94            "is_featured": false,
95            "latitude": 51.513965,
96            "longitude": -0.038837,
97            "address": "123 Kathal St. Tampa City, ",
98            "area": 2123,
99            "room": 4,
100            "bathroom": 3,
101            "balcony": 3,
102            "lounge": 1,
103            "garage": 1,
104            "image": "http://placehold.it/268x220",
105            "type_icon": "img/building.png",
106            "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "
107        },
108        {
109            "id": 6,
110            "title": "Big Head House",
111            "price": 2505.11,
112            "listing_for": "Sale",
113            'author': 'Jhon Doe',
114            'date': '5 days ago',
115            "is_featured": false,
116            "latitude": 51.503965,
117            "longitude": -0.058837,
118            "address": "123 Kathal St. Tampa City, ",
119            "area": 2123,
120            "room": 4,
121            "bathroom": 3,
122            "balcony": 3,
123            "lounge": 1,
124            "garage": 1,
125            "image": "http://placehold.it/268x220",
126            "type_icon": "img/building.png",
127            "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "
128        },
129        {
130            "id": 7,
131            "title": "155/A Valley Street 7",
132            "price": 2505.11,
133            "listing_for": "Rent",
134            'author': 'Jhon Doe',
135            'date': '5 days ago',
136            "is_featured": false,
137            "latitude": 51.555385,
138            "longitude": -0.128274,
139            "address": "123 Kathal St. Tampa City, ",
140            "area": 2123,
141            "room": 4,
142            "bathroom": 3,
143            "balcony": 3,
144            "lounge": 1,
145            "garage": 1,
146            "image": "http://placehold.it/268x220",
147            "type_icon": "img/building.png",
148            "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "
149        },
150        {
151            "id": 8,
152            "title": "4552 Lynn Avenue 1",
153            "price": 2505.11,
154            "listing_for": "Sale",
155            'author': 'Jhon Doe',
156            'date': '5 days ago',
157            "is_featured": false,
158            "latitude": 51.560935,
159            "longitude": -0.111365,
160            "address": "123 Kathal St. Tampa City, ",
161            "area": 2123,
162            "room": 4,
163            "bathroom": 3,
164            "balcony": 3,
165            "lounge": 1,
166            "garage": 1,
167            "image": "http://placehold.it/268x220",
168            "type_icon": "img/building.png",
169            "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "
170        },
171        {
172            "id": 9,
173            "title": "4552 Lynn Avenue 2",
174            "price": 2505.11,
175            "listing_for": "Sale",
176            'author': 'Jhon Doe',
177            'date': '5 days ago',
178            "is_featured": false,
179            "latitude": 51.543803,
180            "longitude": -0.036607,
181            "address": "123 Kathal St. Tampa City, ",
182            "area": 2123,
183            "room": 4,
184            "bathroom": 3,
185            "balcony": 3,
186            "lounge": 1,
187            "garage": 1,
188            "image": "http://placehold.it/268x220",
189            "type_icon": "img/building.png",
190            "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "
191        },
192        {
193            "id": 10,
194            "title": "4552 Lynn Avenue 3",
195            "price": 2505.11,
196            "listing_for": "Sale",
197            'author': 'Jhon Doe',
198            'date': '5 days ago',
199            "is_featured": false,
200            "latitude": 51.527306,
201            "longitude": -0.140977,
202            "address": "123 Kathal St. Tampa City, ",
203            "area": 2123,
204            "room": 4,
205            "bathroom": 3,
206            "balcony": 3,
207            "lounge": 1,
208            "garage": 1,
209            "image": "http://placehold.it/268x220",
210            "type_icon": "img/building.png",
211            "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "
212        },
213        {
214            "id": 11,
215            "title": "4552 Lynn Avenue 4",
216            "price": 2505.11,
217            "listing_for": "Sale",
218            'author': 'Jhon Doe',
219            'date': '5 days ago',
220            "is_featured": false,
221            "latitude": 51.558907,
222            "longitude": -0.041842,
223            "address": "123 Kathal St. Tampa City, ",
224            "area": 2123,
225            "room": 4,
226            "bathroom": 3,
227            "balcony": 3,
228            "lounge": 1,
229            "garage": 1,
230            "image": "http://placehold.it/268x220",
231            "type_icon": "img/building.png",
232            "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "
233        },
234        {
235            "id": 12,
236            "title": "Sweet Family home",
237            "price": 2505.11,
238            "listing_for": "Sale",
239            'author': 'Jhon Doe',
240            'date': '5 days ago',
241            "is_featured": true,
242            "latitude": 51.550644,
243            "longitude": -0.103493,
244            "address": "123 Kathal St. Tampa City, ",
245            "area": 2123,
246            "room": 4,
247            "bathroom": 3,
248            "balcony": 3,
249            "lounge": 1,
250            "garage": 1,
251            "image": "http://placehold.it/268x220",
252            "type_icon": "img/building.png",
253            "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "
254        },
255        {
256            "id": 13,
257            "title": "Sweet Family home",
258            "price": 2505.11,
259            "listing_for": "Sale",
260            'author': 'Jhon Doe',
261            'date': '5 days ago',
262            "is_featured": false,
263            "latitude": 51.532112,
264            "longitude": -0.051885,
265            "address": "123 Kathal St. Tampa City, ",
266            "area": 2123,
267            "room": 4,
268            "bathroom": 3,
269            "balcony": 3,
270            "lounge": 1,
271            "garage": 1,
272            "image": "http://placehold.it/268x220",
273            "type_icon": "img/building.png",
274            "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "
275        },
276        {
277            "id": 14,
278            "title": "4552 Lynn Avenue 7",
279            "price": 2505.11,
280            "listing_for": "Sale",
281            'author': 'Jhon Doe',
282            'date': '5 days ago',
283            "is_featured": true,
284            "latitude": 51.531311,
285            "longitude": -0.052314,
286            "address": "123 Kathal St. Tampa City, ",
287            "area": 2123,
288            "room": 4,
289            "bathroom": 3,
290            "balcony": 3,
291            "lounge": 1,
292            "garage": 1,
293            "image": "http://placehold.it/268x220",
294            "type_icon": "img/building.png",
295            "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "
296        },
297        {
298            "id": 15,
299            "title": "Park avenue",
300            "price": 2505.11,
301            "listing_for": "Sale",
302            'author': 'Jhon Doe',
303            'date': '5 days ago',
304            "is_featured": false,
305            "latitude": 51.530189,
306            "longitude": -0.078750,
307            "address": "123 Kathal St. Tampa City, ",
308            "area": 2123,
309            "room": 4,
310            "bathroom": 3,
311            "balcony": 3,
312            "lounge": 1,
313            "garage": 1,
314            "image": "http://placehold.it/268x220",
315            "type_icon": "img/building.png",
316            "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "
317        }
318
319    ]
320};
321
322function drawInfoWindow(property) {
323    var image = 'img/logo.png';
324    if (property.image) {
325        image = property.image
326    }
327
328    var title = 'N/A';
329    if (property.title) {
330        title = property.title
331    }
332
333    var address = '';
334    if (property.address) {
335        address = property.address
336    }
337
338    var description = 'lorem ipsum dolor sit amet, cfeugiat congue qmper lorem ipsum dolor sit amet';
339    if (property.description) {
340        description = property.description
341    }
342
343    var area = 1000;
344    if (property.area) {
345        area = property.area
346    }
347
348    var Beds = 5;
349    if (property.bedroom) {
350        Beds = property.bedroom
351    }
352
353    var bathroom = 5;
354    if (property.bathroom) {
355        bathroom = property.bathroom
356    }
357
358    var garage = 1;
359    if (property.garage) {
360        garage = property.garage
361    }
362
363    var price = 253.33;
364    if (property.price) {
365        price = property.price
366    }
367
368    var ibContent = '';
369    ibContent =
370        "<div class='map-properties'>" +
371        "<div class='map-img'>" +
372        "<img src='" + image + "'/>" +
373        "</div>" +
374        "<div class='map-content'>" +
375        "<h4><a href='properties-details.html'>" + title + "</a></h4>" +
376        "<p class='address'> <i class='fa fa-map-marker'></i>" + address + "</p>" +
377        "<p class='description'>" + description + "</p>" +
378        "<div class='map-properties-fetures'> " +
379        "<span><i class='flaticon-square-layouting-with-black-square-in-east-area'></i>  " + area + " sqft<sup>2</sup></span> " +
380        "<span><i class='flaticon-bed'></i>  " + Beds + " Bed</span> " +
381        "<span><i class='flaticon-holidays'></i>  " + bathroom + " Bath</span> " +
382        "<span><i class='flaticon-vehicle'></i>    " + garage + " Garages</span> " +
383        "</div>" +
384        "<div class='map-properties-btns'><a href='properties-details.html' class='border-button-sm border-button-theme' style='margin-right:5px;'>$" + price + "</a><a href='properties-details.html' class='button-sm button-theme'>Details</a></div>" +
385        "</div>";
386    return ibContent;
387}
388
389function insertPropertyToArray(property, layout) {
390    var image = 'img/logo.png';
391    if (property.image) {
392        image = property.image
393    }
394
395    var title = 'N/A';
396    if (property.title) {
397        title = property.title
398    }
399
400    var listing_for = 'Sale';
401    if (property.listing_for) {
402        listing_for = property.listing_for
403    }
404
405    var address = '';
406    if (property.address) {
407        address = property.address
408    }
409
410    var description = 'lorem ipsum dolor sit amet, cfeugiat congue qmper lorem ipsum dolor sit amet';
411    if (property.description) {
412        description = property.description
413    }
414
415    var area = 1000;
416    if (property.area) {
417        area = property.area
418    }
419
420    var Beds = 5;
421    if (property.bedroom) {
422        Beds = property.bedroom
423    }
424
425    var bathroom = 5;
426    if (property.bathroom) {
427        bathroom = property.bathroom
428    }
429
430    var garage = 1;
431    if (property.garage) {
432        garage = property.garage
433    }
434
435    var balcony = 1;
436    if (property.balcony) {
437        balcony = property.balcony
438    }
439
440    var lounge = 1;
441    if (property.lounge) {
442        lounge = property.lounge
443    }
444
445    var price = 253.33;
446    if (property.price) {
447        price = property.price
448    }
449
450    var is_featured = '';
451    if (property.is_featured) {
452        is_featured = '<div class="property-tag button alt featured">Featured</div> ';
453    }
454
455    var date = '';
456    if (property.date) {
457        date = property.date;
458    }
459
460    var author = '';
461    if (property.author) {
462        author = property.author;
463    }
464
465    var element = '';
466
467    if(layout == 'grid_layout'){
468        element = '<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12"><div class="property">' +
469            '<!-- Property img --> ' +
470            '<a href="properties-details.html" class="property-img">' +
471            is_featured +
472            '<div class="property-tag button sale">'+listing_for+'</div> ' +
473            '<div class="property-price">$'+price+'</div> ' +
474            '<img src="'+image+'" alt="properties-3" class="img-responsive"> ' +
475            '</a>' +
476            '<!-- Property content --> ' +
477            '<div class="property-content"> ' +
478            '<!-- title --> ' +
479            '<h1 class="title">' +
480            '<a href="properties-details.html">'+title+'</a> ' +
481            '</h1> ' +
482            '<!-- Property address --> ' +
483            '<h3 class="property-address"> ' +
484            '<a href="properties-details.html"> ' +
485            '<i class="fa fa-map-marker"></i>'+address+' ' +
486            '</a> ' +
487            '</h3> ' +
488            '<!-- Facilities List --> ' +
489            '<ul class="facilities-list clearfix"> ' +
490            '<li> ' +
491            '<i class="flaticon-square-layouting-with-black-square-in-east-area"></i> ' +
492            '<span>'+area+' sq ft</span> ' +
493            '</li> ' +
494            '<li> ' +
495            '<i class="flaticon-bed"></i> ' +
496            '<span>'+Beds+' Beds</span> ' +
497            '</li> ' +
498            '<li> ' +
499            '<i class="flaticon-monitor"></i> ' +
500            '<span>TV </span> ' +
501            '</li> ' +
502            '<li> ' +
503            '<i class="flaticon-holidays"></i> ' +
504            '<span> '+bathroom+' Baths</span> ' +
505            '</li> ' +
506            '<li> ' +
507            '<i class="flaticon-vehicle"></i> ' +
508            '<span>'+garage+' Garage</span> ' +
509            '</li> ' +
510            '<li> ' +
511            '<i class="flaticon-building"></i> ' +
512            '<span> '+balcony+' Balcony</span> ' +
513            '</li> ' +
514            '</ul> ' +
515            '<!-- Property footer --> ' +
516            '<div class="property-footer"> ' +
517            '<a class="left"><i class="fa fa-user"></i>
517'+author+'</a> ' +
518            '<span class="right"> ' +
519            '<i class="fa fa-calendar"></i>' + date +
520            '</span> ' +
521            '</div>' +
522            '</div>' +
523            '</div>';
524            '</div>';
525    }
526    else{
527        element = '' +
528            '<div class="property map-properties-list clearfix"> ' +
529            '<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12 col-pad"> ' +
530            '<a href="properties-details.html" class="property-img height"> ' +
531            is_featured +
532            '<div class="property-tag button sale">'+listing_for+'</div> ' +
533            '<div class="property-price">$'+price+'</div> ' +
534            '<img src="'+image+'" alt="properties" class="img-responsive img-inside-map"> ' +
535            '</a> ' +
536            '</div> ' +
537            '<div class="col-lg-7 col-md-7 col-sm-7 col-xs-12 property-content "> ' +
538            '<!-- title --> ' +
539            '<h1 class="title"> ' +
540            '<a href="properties-details.html">'+title+'</a> </h1> ' +
541            '<!-- Property address --> ' +
542            '<h3 class="property-address"> ' +
543            '<a href="properties-details.html"> ' +
544            '<i class="fa fa-map-marker"></i>'+address+', ' +
545            '</a>' +
546            '</h3>' +
547            '<!-- Facilities List --> ' +
548            '<ul class="facilities-list clearfix"> ' +
549            '<li> ' +
550            '<i class="flaticon-square-layouting-with-black-square-in-east-area"></i> ' +
551            '<span>'+area+' sq ft</span> ' +
552            '</li> ' +
553            '<li> ' +
554            '<i class="flaticon-bed"></i> ' +
555            '<span>'+Beds+' Beds</span> ' +
556            '</li> ' +
557            '<li> ' +
558            '<i class="flaticon-monitor"></i> ' +
559            '<span>TV </span> ' +
560            '</li> ' +
561            '<li> ' +
562            '<i class="flaticon-holidays"></i>' +
563            '<span> '+bathroom+' Baths</span> ' +
564            '</li> ' +
565            '<li> ' +
566            '<i class="flaticon-vehicle"></i>' +
567            '<span>'+garage+' Garage</span>' +
568            '</li> ' +
569            '<li> ' +
570            '<i class="flaticon-building"></i> ' +
571            '<span> '+balcony+' Balcony</span> ' +
572            '</li> ' +
573            '</ul> ' +
574            '<!-- Property footer --> ' +
575            '<div class="property-footer"> ' +
576            '<a class="left" href="#"><i class="fa fa-user"></i>'+author+'</a> ' +
577            '<span class="right"> ' +
578            '<i class="fa fa-calendar"></i>' + date +
579            '</span> ' +
580            '</div> ' +
581            '</div> ' +
582            '</div>';
583    }
584    return element;
585}
586
587function animatedMarkers(map, propertiesMarkers, properties, layout) {
588    var bounds = map.getBounds();
589    var propertiesArray = [];
590    $.each(propertiesMarkers, function (key, value) {
591        if (bounds.contains(propertiesMarkers[key].getLatLng())) {
592            propertiesArray.push(insertPropertyToArray(properties.data[key], layout));
593            setTimeout(function () {
594                if (propertiesMarkers[key]._icon != null) {
595                    propertiesMarkers[key]._icon.className = 'leaflet-marker-icon leaflet-zoom-animated leaflet-clickable bounce-animation marker-loaded';
596                }
597            }, key * 50);
598        }
599        else {
600            if (propertiesMarkers[key]._icon != null) {
601                propertiesMarkers[key]._icon.className = 'leaflet-marker-icon leaflet-zoom-animated leaflet-clickable';
602            }
603        }
604    });
605    $('.fetching-properties').html(propertiesArray);
606}
607
608function generateMap(latitude, longitude, mapProvider, layout) {
609
610    var map = L.map('map', {
611        center: [latitude, longitude],
612        zoom: 14,
613        scrollWheelZoom: false
614    });
615
616    L.tileLayer.provider(mapProvider).addTo(map);
617    var markers = L.markerClusterGroup({
618        showCoverageOnHover: false,
619        zoomToBoundsOnClick: false
620    });
621    var propertiesMarkers = [];
622
623    $.each(properties.data, function (index, property) {
624        var icon = '<img src="img/logos/logo.png">';
625        if (property.type_icon) {
626            icon = '<img src="' + property.type_icon + '">';
627        }
628        var color = '';
629        var markerContent =
630            '<div class="map-marker ' + color + '">' +
631            '<div class="icon">' +
632            icon +
633            '</div>' +
634            '</div>';
635
636        var _icon = L.divIcon({
637            html: markerContent,
638            iconSize: [36, 46],
639            iconAnchor: [18, 32],
640            popupAnchor: [130, -28],
641            className: ''
642        });
643
644        var marker = L.marker(new L.LatLng(property.latitude, property.longitude), {
645            title: property.title,
646            icon: _icon
647        });
648
649        propertiesMarkers.push(marker);
650        marker.bindPopup(drawInfoWindow(property));
651        markers.addLayer(marker);
652        marker.on('popupopen', function () {
653            this._icon.className += ' marker-active';
654        });
655        marker.on('popupclose', function () {
656            this._icon.className = 'leaflet-marker-icon leaflet-zoom-animated leaflet-clickable marker-loaded';
657        });
658    });
659
660    map.addLayer(markers);
661    animatedMarkers(map, propertiesMarkers, properties, layout);
662    map.on('moveend', function () {
663        animatedMarkers(map, propertiesMarkers, properties, layout);
664    });
665
666    $('.fetching-properties .item').hover(
667        function () {
668            propertiesMarkers[$(this).attr('id') - 1]._icon.className = 'leaflet-marker-icon leaflet-zoom-animated leaflet-clickable marker-loaded marker-active';
669        },
670        function () {
671            propertiesMarkers[$(this).attr('id') - 1]._icon.className = 'leaflet-marker-icon leaflet-zoom-animated leaflet-clickable marker-loaded';
672        }
673    );
674
675    $('.geolocation').on("click", function () {
676        map.locate({setView: true})
677    });
678    $('#map').removeClass('fade-map');
679}

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.