{"id":14711,"date":"2019-05-01T11:45:16","date_gmt":"2019-05-01T11:45:16","guid":{"rendered":"https:\/\/houzez01.favethemes.com\/?page_id=14711"},"modified":"2019-05-01T11:45:16","modified_gmt":"2019-05-01T11:45:16","slug":"mapsh","status":"publish","type":"page","link":"https:\/\/dcasainmobiliaria.com\/index.php\/mapsh\/","title":{"rendered":"mapsh"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>\t\t\t\t[vc_row][vc_column]\n            <script>\n\n                jQuery( function( $ ) {\n                    'use strict';\n\n                    \/* Properties Array *\/\n                    var properties = [];\n                    var is_marker_cluster = HOUZEZ_ajaxcalls_vars.is_marker_cluster;\n                    var markerPricePins = HOUZEZ_ajaxcalls_vars.markerPricePins;\n                    var osm_markers_cluster;\n                    var propertyMarker;\n                    var is_mapbox = HOUZEZ_ajaxcalls_vars.is_mapbox;\n                    var api_mapbox = HOUZEZ_ajaxcalls_vars.api_mapbox;\n\n                    if ( 0 < properties.length ) {\n\n                        if(is_mapbox == 'mapbox' && api_mapbox != '') {\n\n                            var tileLayer = L.tileLayer( 'https:\/\/api.tiles.mapbox.com\/v4\/{id}\/{z}\/{x}\/{y}.png?access_token='+api_mapbox, {\n                                attribution: '&copy; <a href=\"https:\/\/www.openstreetmap.org\/copyright\">OpenStreetMap<\/a> contributors',\n                                maxZoom: 18,\n                                id: 'mapbox.streets',\n                                accessToken: 'your.mapbox.access.token'\n                                } \n                            );\n\n                        } else {\n                            var tileLayer = L.tileLayer( 'https:\/\/{s}.tile.openstreetmap.org\/{z}\/{x}\/{y}.png', {\n                                attribution : '&copy; <a href=\"https:\/\/www.openstreetmap.org\/copyright\">OpenStreetMap<\/a> contributors'\n                            } );\n                        }\n\n                        \/\/ get map bounds\n                        var mapBounds = [];\n                        for( var i = 0; i < properties.length; i++ ) {\n                            if ( properties[i].lat && properties[i].lng ) {\n                                mapBounds.push( [ properties[i].lat, properties[i].lng ] );\n                            }\n                        }\n\n                        \/\/ Basic map\n                        var markerLatLng = L.latLng( 28.664827, -82.515755 );\n                        if ( 1 == mapBounds.length ) {\n                            markerLatLng = L.latLng( mapBounds[0] );  \n                        }\n                        var mapDragging = (L.Browser.mobile) ? false : true;\n                        var mapOptions = {\n                            dragging: mapDragging,\n                            center: markerLatLng,\n                            zoom: 10\n                        };\n                        var propertiesMap = L.map( 'houzez-listing-map-vc', mapOptions );\n\n                        propertiesMap.scrollWheelZoom.disable();\n\n                        if ( 1 < mapBounds.length ) {\n                            propertiesMap.fitBounds( mapBounds );\n                        }\n\n                        propertiesMap.addLayer( tileLayer );\n\n                        if(is_marker_cluster == 1) {\n                            osm_markers_cluster = new L.MarkerClusterGroup({ \n                                iconCreateFunction: function (cluster) {\n                                    var markers1 = cluster.getAllChildMarkers();\n                                    var html = '<div class=\"houzez-osm-cluster\">' + markers1.length + '<\/div>';\n                                    return L.divIcon({ html: html, className: 'mycluster', iconSize: L.point(47, 47) });\n                                },\n                                spiderfyOnMaxZoom: true, showCoverageOnHover: true, zoomToBoundsOnClick: true \n                            });\n                        }\n\n                        for( var i = 0; i < properties.length; i++ ) {\n\n                            if ( properties[i].lat && properties[i].lng ) {\n\n                                var prop = properties[i];\n\n                                var markerLatLng = L.latLng( prop.lat, prop.lng );\n                                var prop_title = prop.data ? prop.data.post_title : prop.title;\n\n                                if( markerPricePins == 'yes' ) {\n                                    var pricePin = '<div data-id=\"'+prop.id+'\" class=\"gm-marker gm-marker-color-'+prop.term_id+'\"><div class=\"gm-marker-price\">'+prop.pricePin+'<\/div><\/div>';\n\n                                    var myIcon = L.divIcon({ \n                                        className:'someclass',\n                                        iconSize: new L.Point(0, 0), \n                                        html: pricePin\n                                    });\n\n                                    if(is_marker_cluster == 1) {\n                                        propertyMarker = new L.Marker(markerLatLng, {icon: myIcon});\n                                    } else {\n                                        propertyMarker = L.marker( markerLatLng,{icon: myIcon} ).addTo( propertiesMap );\n                                    }\n\n                                } else {\n\n                                    \/\/ OSM Marker\n                                    var osmMarkerOptions = {\n                                        riseOnHover: true\n                                    };\n\n                                    if ( prop_title != '' ) {\n                                        osmMarkerOptions.title = prop_title;\n                                    }\n\n                                    \/\/ Marker icon\n                                    if ( prop.icon ) {\n                                        var iconOptions = {\n                                            iconUrl: prop.icon,\n                                            iconSize: [44, 56],\n                                            iconAnchor: [20, 57],\n                                            popupAnchor: [1, -57]\n                                        };\n                                        if ( prop.retinaIcon ) {\n                                            iconOptions.iconRetinaUrl = prop.retinaIcon;\n                                        }\n                                        osmMarkerOptions.icon = L.icon( iconOptions );\n                                    }\n\n                                    if(is_marker_cluster == 1) {\n                                        propertyMarker = new L.Marker(markerLatLng, osmMarkerOptions);\n                                    } else {\n                                        propertyMarker = L.marker( markerLatLng, osmMarkerOptions ).addTo( propertiesMap );\n                                    }\n                                }\n\n                                if(is_marker_cluster == 1) {\n                                    osm_markers_cluster.addLayer(propertyMarker);\n                                }\n\n                                var propMeta = prop.prop_meta;\n                                if( propMeta == null ) {\n                                    propMeta = '';\n                                }\n\n                                var infoboxContent = document.createElement(\"div\");\n                                infoboxContent.className = 'property-item item-grid map-info-box osm-info-window';\n                                infoboxContent.innerHTML = '' +\n                                    '<div class=\"figure-block\">' +\n                                    '<figure class=\"item-thumb\">' +\n                                    '<div class=\"price hide-on-list\">' +\n                                    '<span class=\"item-price\">'+prop.price+'<\/span>' +\n                                    '<\/div>' +\n                                    '<a href=\"'+prop.url+'\" class=\"hover-effect\" tabindex=\"0\">' + prop.thumbnail + '<\/a>' +\n                                    '<\/figure>' +\n                                    '<\/div>' +\n                                    '<div class=\"item-body\">' +\n                                    '<div class=\"body-left\">' +\n                                    '<div class=\"info-row\">' +\n                                    '<h2><a href=\"'+prop.url+'\">'+prop_title+'<\/a><\/h2>' +\n                                    '<h4>'+prop.full_address+'<\/h4>' +\n                                    '<\/div>' +\n                                    '<div class=\"table-list full-width info-row\">' +\n                                    '<div class=\"cell\">' +\n                                    '<div class=\"info-row amenities\">' + propMeta +\n                                    '<p>'+prop.type+'<\/p>' +\n                                    '<\/div>' +\n                                    '<\/div>' +\n                                    '<\/div>' +\n                                    '<\/div>' +\n                                    '<\/div>';\n                                \n                                    propertyMarker.bindPopup( infoboxContent );\n\n                            }\n\n                        }\n\n                        if(is_marker_cluster == 1) {\n                            propertiesMap.addLayer(osm_markers_cluster);\n                        }\n\n                    } else {\n\n                        \/\/ Fallback Map\n                        if(is_mapbox == 'mapbox' && api_mapbox != '') {\n\n                            var fallbackLayer = L.tileLayer( 'https:\/\/api.tiles.mapbox.com\/v4\/{id}\/{z}\/{x}\/{y}.png?access_token='+api_mapbox, {\n                                attribution: '&copy; <a href=\"https:\/\/www.openstreetmap.org\/copyright\">OpenStreetMap<\/a> contributors',\n                                maxZoom: 18,\n                                id: 'mapbox.streets',\n                                accessToken: 'your.mapbox.access.token'\n                                } \n                            );\n\n                        } else {\n                            var fallbackLayer = L.tileLayer( 'https:\/\/{s}.tile.openstreetmap.org\/{z}\/{x}\/{y}.png', {\n                                attribution : '&copy; <a href=\"https:\/\/www.openstreetmap.org\/copyright\">OpenStreetMap<\/a> contributors'\n                            } );\n                        }\n\n                        var fallbackMapOptions = {\n                            center : [28.664827, -82.515755],\n                            zoom : 12\n                        };\n\n                        var fallbackMap = L.map( 'houzez-listing-map-vc', fallbackMapOptions );\n                        fallbackMap.addLayer( fallbackLayer );\n                        fallbackMap.scrollWheelZoom.disable();\n\n                    }\n                } );\n            <\/script>\n\n\n        \n        <div id=\"houzez-gmap-vc-module\">\n            <div style=\"height: 550px; position: relative\" id=\"houzez-listing-map-vc\"><\/div>\n        <\/div>\n\n\n        [\/vc_column][\/vc_row]\t\t<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>[vc_row][vc_column][\/vc_column][\/vc_row]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"template\/template-homepage.php","meta":{"_joinchat":[],"footnotes":""},"class_list":["post-14711","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/dcasainmobiliaria.com\/index.php\/wp-json\/wp\/v2\/pages\/14711","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dcasainmobiliaria.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/dcasainmobiliaria.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/dcasainmobiliaria.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dcasainmobiliaria.com\/index.php\/wp-json\/wp\/v2\/comments?post=14711"}],"version-history":[{"count":0,"href":"https:\/\/dcasainmobiliaria.com\/index.php\/wp-json\/wp\/v2\/pages\/14711\/revisions"}],"wp:attachment":[{"href":"https:\/\/dcasainmobiliaria.com\/index.php\/wp-json\/wp\/v2\/media?parent=14711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}