var beansUrlParameter = function(sParam) { var sPageURL = window.location.search.substring(1), sURLVariables = sPageURL.split('&'), sParameterName, i; for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); if (sParameterName[0] === sParam) { return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]); } } } var getBaseConfig = function(urlFromRequest) { return { address: '', useGroundElevation: false, elevation: 0, canonicalUrl: urlFromRequest }; } var convertUnitsArr2 = function(address, unitsArr, hideMarkers) { var convertedArr = []; for (var i = 0; i < unitsArr.length; i++) { var bedText = (unitsArr[i].bed && unitsArr[i].bed !== '0') ? (unitsArr[i].bed + ' Bed') : 'Studio'; var td = new Date().toISOString().substring(0, 10); var as = (unitsArr[i].availability ? ('on ' + unitsArr[i].availability) : 'Now'); if (unitsArr[i].availability && unitsArr[i].availability <= td) { as = 'Now'; } var onPreviewData; if (unitsArr.floorplanImg) { onPreviewData = [ { value: bedText + ' / ' + unitsArr[i].bath + ' Bath / ' + (unitsArr[i].sqft ? unitsArr[i].sqft.toLocaleString() : '0') + ' sq. ft.' }, { value: 'img:' + unitsArr[i].floorplanImg }, { value: '$' + (unitsArr[i].rent ? unitsArr[i].rent.toLocaleString() : '0') + '/ mo' }, { value: 'Available ' + as } ]; } else { onPreviewData = [ { value: bedText + ' / ' + unitsArr[i].bath + ' Bath / ' + (unitsArr[i].sqft ? unitsArr[i].sqft.toLocaleString() : '0') + ' sq. ft.' }, { value: '$' + (unitsArr[i].rent ? unitsArr[i].rent.toLocaleString() : '0') + '/ mo' }, { value: 'Available ' + as } ]; } convertedArr.push({ address: address, unit: unitsArr[i].unit, options: { markers: { display: hideMarkers ? false : true }, poi: [ { name: "ALL", display: false }, { name: "CLUBHOUSE", display: true }, { name: "SWIMMINGPOOL", display: true }, { name: "OFFICE", display: true }, { name: "GYM", display: true }, { name: "MAILROOM", display: true }, { name: "LAUNDRY", display: true }, { name: "PLAYGROUND", display: true } ], onPreviewData: onPreviewData, onClickData: { name: unitsArr[i].unit ? unitsArr[i].unit.replaceAll('||', ' - ') : '', bed: unitsArr[i].bed, bath: unitsArr[i].bath, sqft: unitsArr[i].sqft, rent: unitsArr[i].rent, floorplanImg: unitsArr[i].floorplanImg, availability: unitsArr[i].availability, link: unitsArr[i].link ? unitsArr[i].link.replaceAll('&', '&') : '' } } }); } return convertedArr; } var convertUnitsArr = function(config, unitsArr, hideMarkers, skipSort) { var addressAndUnitWithOptions; if (unitsArr.length === 0) { unitsArr.push({ unit: '' }); addressAndUnitWithOptions = convertUnitsArr2(config.address, unitsArr, hideMarkers); addressAndUnitWithOptions[0].isPlaceHolder = true; } else { if (!skipSort) { unitsArr.sort((a, b) => { var aa = a.unit ? a.unit : ''; var bb = b.unit ? b.unit : ''; return aa.localeCompare(bb); }); } addressAndUnitWithOptions = convertUnitsArr2(config.address, unitsArr, hideMarkers); } if (config.unitShapeConfig) { for (var i = 0; i < addressAndUnitWithOptions.length; i++) { addressAndUnitWithOptions[i].options.unitShape = config.unitShapeConfig(addressAndUnitWithOptions[i]); } } if (config.poi) { for (var i = 0; i < addressAndUnitWithOptions.length; i++) { for (var j = 0; j < config.poi.length; j++) { addressAndUnitWithOptions[i].options.poi.push(config.poi[j]); } } } return addressAndUnitWithOptions; } var commonImmersives = [ { url: "https://gis-server.beans.ai/arcgis/rest/services/Hosted/Immersive_Layers/FeatureServer/0", elevationInfo: { mode: "absolute-height", offset: 0.1, }, opacity: 0.5, immersiveType: 'trees', renderer: { type: "unique-value", field: "type", uniqueValueInfos: [ { value: "Apricot", symbol: { type: "point-3d", symbolLayers: [ { type: "object", "height": 6, "anchor": "origin", "resource": { "href": "https://static.arcgis.com/arcgis/styleItems/RealisticTrees/gltf/resource/PrunusArmeniaca.glb" } } ] } }, { value: "Mountain Mahogany", symbol: { type: "point-3d", symbolLayers: [ { type: "object", "height": 2, "anchor": "origin", "resource": { "href": "https://static.arcgis.com/arcgis/styleItems/RealisticTrees/gltf/resource/CercocarpusMontanus.glb" } } ] } }, { value: "Rose", symbol: { type: "point-3d", symbolLayers: [ { type: "object", "height": 2, "anchor": "origin", "resource": { "href": "https://static.arcgis.com/arcgis/styleItems/RealisticTrees/gltf/resource/RosaGrandiflora.glb" } } ] } } ] }, isFeature: true }, { url: "https://gis-server.beans.ai/arcgis/rest/services/Hosted/Immersive_Layers/FeatureServer/1", elevationInfo: { mode: "absolute-height", offset: 0.2, }, renderer: { type: "unique-value", field: "type", uniqueValueInfos: [ { value: "Walkway", symbol: { type: "line-3d", symbolLayers: [ { type: "path", profile: "quad", material: { color: "#fcf5de" }, width: 2, // the width in m height: 0.3, // the height in m profileRotation: "heading" } ] // type: "simple-line", // width: 16, // color: "#aaaaaa" } }, { value: "Road", symbol: { type: "line-3d", symbolLayers: [ { type: "path", profile: "quad", material: { color: "#aaaaaa" }, width: 6, // the width in m height: 0.4, // the height in m profileRotation: "heading" } ] } } ] }, isFeature: true }, { url: "https://gis-server.beans.ai/arcgis/rest/services/Hosted/Immersive_Layers/FeatureServer/2", elevationInfo: { mode: "absolute-height", offset: 0.1, }, renderer: { type: "unique-value", field: "type", uniqueValueInfos: [ { value: "Lawn", symbol: { type: "simple-fill", outline: { width: 0 }, color: "rgba(178, 195, 136, 0.35)" } }, { value: "Concrete", symbol: { type: "simple-fill", outline: { width: 0 }, color: "#CCCCCC" } }, { value: "Mulch", symbol: { type: "simple-fill", outline: { width: 0 }, color: "#DBCEA2" } } ] }, isFeature: true }, { url: "https://gis-server.beans.ai/arcgis/rest/services/Hosted/Immersive_Layers/FeatureServer/2", elevationInfo: { mode: "absolute-height", offset: 0.2, }, renderer: { type: "unique-value", field: "type", uniqueValueInfos: [ { value: "Water", symbol: { type: "simple-fill", outline: { width: 0 }, color: "#a5c2d1" } } ] }, isFeature: true }, ]; var getDisplayOptions = function( config, unitShape_, // Default shape selectedUnitShape_, // Selected shape selectableUnitShape_, // Selectable shape hoverUnitShape_ ) { return { propertyAddress: config.address, offsetGroundElevation: config.elevation, useGroundElevation: config.useGroundElevation, filters: config.filters, showUnitList: true, showUnitShape: true, showDirections: false, showPath: false, camera: config.camera, mobileCamera: config.mobileCamera, renameAmenities: config.renameAmenities ? config.renameAmenities : null, shadowModeUnitShape: config.shadowModeUnitShape ? config.shadowModeUnitShape : { fillColor: '#ffffff', fillOpacity: 1.0, }, neighborModeUnitShape: config.neighborModeUnitShape ? config.neighborModeUnitShape : { fillColor: '#D8D7D4', fillOpacity: 1.0, }, unitShape: config.unitShape ? config.unitShape : { fillColor: '#DDE3E0', fillOpacity: 1.0, strokeWeight: 1.0, strokeOpacity: 0.5, strokeColor: '#000000', ...unitShape_ }, selectedUnitShape: config.selectedUnitShape ? config.selectedUnitShape : { fillColor: '#A6671D', fillOpacity: 1.0, strokeWeight: 1.0, strokeOpacity: 1.0, strokeColor: '#ffffff', ...selectedUnitShape_ }, selectableUnitShape: config.selectableUnitShape ? config.selectableUnitShape : { fillColor: '#24453E', fillOpacity: 1.0, strokeWeight: 1.0, strokeOpacity: 1.0, strokeColor: '#ffffff', ...selectableUnitShape_ }, satelliteModeUnitShape: config.satelliteModeUnitShape ? config.satelliteModeUnitShape : { fillColor: '#ffffff', fillOpacity: 1.0, }, neighborShape: config.neighborShape, immersiveModeUnitShape: config.immersiveModeUnitShape, poiShape: config.poiShape, hoverUnitShape: hoverUnitShape_ ? hoverUnitShape_ : null, // mobileUnitShape: { // fillColor: '#ffffff', // fillOpacity: 0.2, // strokeWeight: 0.5, // strokeOpacity: 0.2, // strokeColor: '#000000', // } }; } var BeansPlatformr = function() { }; BeansPlatformr.prototype.getConfigFromUrl = function(urlFromRequest) { var canonicalUrl = urlFromRequest ? urlFromRequest : window.location.hostname; if (beansUrlParameter('canonicalUrl')) { canonicalUrl = beansUrlParameter('canonicalUrl'); } var baseConfig = getBaseConfig(canonicalUrl); var config = {}; config["www.liveatmidtownarlington.com"] = { camera: {tilt: 62.68438704654362, heading: 26.763178741414738, position: {x: -97.12405323984005, y: 32.73333485838261, z: 106.63640766777098}}, address: "1121 UTA Blvd, Arlington, TX", unitShape: { fillColor: '#EAD6C3', fillOpacity: 0.5, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, selectedUnitShape: { fillColor: '#C7A33B', }, selectableUnitShape: { fillColor: '#9DD7DF', }, unitsArr: [{unit: "105"}, {unit: "106"}, {unit: "107"}, {unit: "108"}, {unit: "109"}, {unit: "110"}, {unit: "111"}, {unit: "112"}, {unit: "113"}, {unit: "114"}, {unit: "115"}, {unit: "116"}, {unit: "117"}, {unit: "118"}, {unit: "119"}, {unit: "201"}, {unit: "203"}, {unit: "205"}, {unit: "206"}, {unit: "207"}, {unit: "208"}, {unit: "209"}, {unit: "210"}, {unit: "211"}, {unit: "212"}, {unit: "213"}, {unit: "214"}, {unit: "215"}, {unit: "216"}, {unit: "217"}, {unit: "218"}, {unit: "219"}, {unit: "220"}, {unit: "222"}, {unit: "301"}, {unit: "303"}, {unit: "305"}, {unit: "306"}, {unit: "307"}, {unit: "309"}, {unit: "310"}, {unit: "311"}, {unit: "312"}, {unit: "313"}, {unit: "315"}, {unit: "316"}, {unit: "317"}, {unit: "318"}, {unit: "319"}, {unit: "320"}, {unit: "322"}, {unit: "401"}, {unit: "403"}, {unit: "405"}, {unit: "406"}, {unit: "409"}, {unit: "410"}, {unit: "411"}, {unit: "412"}, {unit: "413"}, {unit: "415"}, {unit: "417"}, {unit: "418"}, {unit: "419"}, {unit: "420"}, {unit: "422"}], }; config["www.theedgeattech.com"] = { camera: {tilt: 57.1719823469066, heading: 315.7070917211918, position: {x: -85.52660454695756, y: 36.17973196884953, z: 248.42347208410501}}, address: "1400 Gainesboro Grade, Cookeville, TN", unitShape: { fillColor: '#EAD6C3', fillOpacity: 0.5, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, selectedUnitShape: { fillColor: '#5B3F98', }, selectableUnitShape: { fillColor: '#FFC51A', }, unitsArr: [{unit: "A101"}, {unit: "A102"}, {unit: "A103"}, {unit: "A104"}, {unit: "A201"}, {unit: "A202"}, {unit: "A203"}, {unit: "A204"}, {unit: "A301"}, {unit: "A302"}, {unit: "A303"}, {unit: "A304"}, {unit: "B101"}, {unit: "B102"}, {unit: "B103"}, {unit: "B104"}, {unit: "B201"}, {unit: "B202"}, {unit: "B203"}, {unit: "B204"}, {unit: "B301"}, {unit: "B302"}, {unit: "B303"}, {unit: "B304"}, {unit: "C101"}, {unit: "C102"}, {unit: "C103"}, {unit: "C104"}, {unit: "C201"}, {unit: "C202"}, {unit: "C203"}, {unit: "C204"}, {unit: "C301"}, {unit: "C302"}, {unit: "C303"}, {unit: "C304"}, {unit: "D101"}, {unit: "D102"}, {unit: "D103"}, {unit: "D104"}, {unit: "D201"}, {unit: "D202"}, {unit: "D203"}, {unit: "D204"}, {unit: "D301"}, {unit: "D302"}, {unit: "D303"}, {unit: "D304"}, {unit: "E101"}, {unit: "E102"}, {unit: "E103"}, {unit: "E104"}, {unit: "E201"}, {unit: "E202"}, {unit: "E203"}, {unit: "E204"}, {unit: "E301"}, {unit: "E302"}, {unit: "E303"}, {unit: "E304"}, {unit: "F101"}, {unit: "F102"}, {unit: "F103"}, {unit: "F104"}, {unit: "F201"}, {unit: "F202"}, {unit: "F203"}, {unit: "F204"}, {unit: "F301"}, {unit: "F302"}, {unit: "F303"}, {unit: "F304"}, {unit: "G101"}, {unit: "G102"}, {unit: "G103"}, {unit: "G104"}, {unit: "G201"}, {unit: "G202"}, {unit: "G203"}, {unit: "G204"}, {unit: "G301"}, {unit: "G302"}, {unit: "G303"}, {unit: "G304"}, {unit: "H101"}, {unit: "H102"}, {unit: "H103"}, {unit: "H104"}, {unit: "H201"}, {unit: "H202"}, {unit: "H203"}, {unit: "H204"}, {unit: "H301"}, {unit: "H302"}, {unit: "H303"}, {unit: "H304"}], }; config["www.fitzroychenal.com"] = { camera: {tilt: 54.33523535842086, heading: 80.23952283618186, position: {x: -92.44376200821767, y: 34.754353326829694, z: 172.75217247754335}}, address: "15401 Chenal Parkway, Little Rock, AR", unitShape: { fillColor: '#EAD6C3', fillOpacity: 0.5, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, selectedUnitShape: { fillColor: '#E4B142', }, selectableUnitShape: { fillColor: '#222222', }, propertyId: "1128695", }; config["www.chenalcommonsapts.com"] = { camera: {tilt: 56.8870526564582, heading: 356.1634861716081, position: {x: -92.45500747393862, y: 34.77003087602338, z: 248.88709848280996}}, address: "16401 Chenal Valley Dr, Little Rock, AR", unitShape: { fillColor: '#EAD6C3', fillOpacity: 0.5, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, selectedUnitShape: { fillColor: '#095c71', }, selectableUnitShape: { fillColor: '#FFC51A', }, }; config["www.theedgeatrouse.com"] = { camera: {tilt: 61.66182982835535, heading: 159.02166435605025, position: {x: -94.68823672729035, y: 37.38732335632012, z: 112.38800198026001}}, address: "2010 S Rouse St, Pittsburg, KS", unitShape: { fillColor: '#EAD6C3', fillOpacity: 0.5, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, selectedUnitShape: { fillColor: '#AE2C33', }, selectableUnitShape: { fillColor: '#FCD116', }, unitsArr: [{unit: "2006-1101"}, {unit: "2006-1102"}, {unit: "2006-1103"}, {unit: "2006-1104"}, {unit: "2006-1201"}, {unit: "2006-1202"}, {unit: "2006-1203"}, {unit: "2006-1204"}, {unit: "2006-1301"}, {unit: "2006-1302"}, {unit: "2006-1303"}, {unit: "2006-1304"}, {unit: "2008-2101"}, {unit: "2008-2102"}, {unit: "2008-2103"}, {unit: "2008-2104"}, {unit: "2008-2201"}, {unit: "2008-2202"}, {unit: "2008-2203"}, {unit: "2008-2204"}, {unit: "2008-2301"}, {unit: "2008-2302"}, {unit: "2008-2303"}, {unit: "2008-2304"}, {unit: "2012-3101"}, {unit: "2012-3102"}, {unit: "2012-3103"}, {unit: "2012-3104"}, {unit: "2012-3201"}, {unit: "2012-3202"}, {unit: "2012-3203"}, {unit: "2012-3204"}, {unit: "2012-3301"}, {unit: "2012-3302"}, {unit: "2012-3303"}, {unit: "2012-3304"}, {unit: "2014-4101"}, {unit: "2014-4102"}, {unit: "2014-4103"}, {unit: "2014-4104"}, {unit: "2014-4201"}, {unit: "2014-4202"}, {unit: "2014-4203"}, {unit: "2014-4204"}, {unit: "2014-4301"}, {unit: "2014-4302"}, {unit: "2014-4303"}, {unit: "2014-4304"}, {unit: "2016-5101"}, {unit: "2016-5102"}, {unit: "2016-5103"}, {unit: "2016-5104"}, {unit: "2016-5201"}, {unit: "2016-5202"}, {unit: "2016-5203"}, {unit: "2016-5204"}, {unit: "2016-5301"}, {unit: "2016-5302"}, {unit: "2016-5303"}, {unit: "2016-5304"}, {unit: "2018-6101"}, {unit: "2018-6102"}, {unit: "2018-6103"}, {unit: "2018-6104"}, {unit: "2018-6201"}, {unit: "2018-6202"}, {unit: "2018-6203"}, {unit: "2018-6204"}, {unit: "2018-6301"}, {unit: "2018-6302"}, {unit: "2018-6303"}, {unit: "2018-6304"}], }; config["www.liveatlibertylofts.com"] = { camera: {tilt: 59.5367974258114, heading: 338.7588050214547, position: {x: -97.35954895272424, y: 32.69508460220344, z: 139.48696745652705}}, address: "3517 S University Dr, Fort Worth, TX", unitShape: { fillColor: '#EAD6C3', fillOpacity: 0.5, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, selectedUnitShape: { fillColor: '#BF0D3E', }, selectableUnitShape: { fillColor: '#3F1F08', }, unitsArr: [{unit: "3517-1201"}, {unit: "3517-1202"}, {unit: "3517-1203"}, {unit: "3600-3101"}, {unit: "3600-3102"}, {unit: "3600-3103"}, {unit: "3600-3104"}, {unit: "3600-3105"}, {unit: "3600-3106"}, {unit: "3600-3201"}, {unit: "3600-3202"}, {unit: "3600-3203"}, {unit: "3600-3204"}, {unit: "3600-3205"}, {unit: "3600-3206"}, {unit: "3600-3301"}, {unit: "3600-3302"}, {unit: "3600-3303"}, {unit: "3600-3304"}, {unit: "3600-3305"}, {unit: "3600-3306"}, {unit: "3601-2101"}, {unit: "3601-2102"}, {unit: "3601-2103"}, {unit: "3601-2104"}, {unit: "3601-2105"}, {unit: "3601-2106"}, {unit: "3601-2107"}, {unit: "3601-2108"}, {unit: "3601-2201"}, {unit: "3601-2202"}, {unit: "3601-2203"}, {unit: "3601-2204"}, {unit: "3601-2205"}, {unit: "3601-2206"}, {unit: "3601-2207"}, {unit: "3601-2208"}, {unit: "3620-4101"}, {unit: "3620-4102"}, {unit: "3620-4103"}, {unit: "3620-4104"}, {unit: "3620-4105"}, {unit: "3620-4106"}, {unit: "3620-4201"}, {unit: "3620-4202"}, {unit: "3620-4203"}, {unit: "3620-4204"}, {unit: "3620-4205"}, {unit: "3620-4206"}, {unit: "3620-4301"}, {unit: "3620-4302"}, {unit: "3620-4303"}, {unit: "3620-4304"}, {unit: "3620-4305"}, {unit: "3620-4306"}], }; config["www.fitzroypromenade.com"] = { camera: {tilt: 49.40761109688381, heading: 285.83112297317416, position: {x: -92.4563871654845, y: 34.76451555925111, z: 291.28793749399483}}, address: "701 Rahling Rd, Little Rock, AR", unitShape: { fillColor: '#EAD6C3', fillOpacity: 0.5, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, selectedUnitShape: { fillColor: '#222222', }, selectableUnitShape: { fillColor: '#E8B037', }, data: true, link: 'https://8508698.onlineleasing.realpage.com/', }; for (var i = 0; i < config['www.theedgeatrouse.com'].unitsArr.length; i++) { config['www.theedgeatrouse.com'].unitsArr[i] = { ...config['www.theedgeatrouse.com'].unitsArr[i], floorplanImg: 'https://assets-global.website-files.com/6596e569123323dd11213372/6596e569123323dd11213389_floorplan.jpeg', bed: 4, bath: 4, sqft: 353, rent: 499 }; } for (var i = 0; i < config['www.liveatmidtownarlington.com'].unitsArr.length; i++) { var unit = config['www.liveatmidtownarlington.com'].unitsArr[i]; if (unit.unit.endsWith("01") || unit.unit.endsWith("02") || unit.unit.endsWith("03") || unit.unit.endsWith("05") || unit.unit.endsWith("06") || unit.unit.endsWith("17") || unit.unit.endsWith("18") || unit.unit.endsWith("19") || unit.unit.endsWith("20") || unit.unit.endsWith("22")) { config['www.liveatmidtownarlington.com'].unitsArr[i] = { ...config['www.liveatmidtownarlington.com'].unitsArr[i], floorplanImg: 'https://assets-global.website-files.com/6417a1936e627e04871b7c48/64180ada3c998579fd1c174d_Maverick%204x4.png', bed: 4, bath: 4, sqft: 1492, rent: 675 }; } else if (unit.unit.endsWith("07") || unit.unit.endsWith("10") || unit.unit.endsWith("11") || unit.unit.endsWith("12") || unit.unit.endsWith("13") || unit.unit.endsWith("16")) { config['www.liveatmidtownarlington.com'].unitsArr[i] = { ...config['www.liveatmidtownarlington.com'].unitsArr[i], floorplanImg: 'https://assets-global.website-files.com/6417a1936e627e04871b7c48/6493446eed6876618af6f022_image-6.jpeg', bed: 3, bath: 3, sqft: 1200, rent: 785 }; } else if (unit.unit.endsWith("08") || unit.unit.endsWith("09") || unit.unit.endsWith("14") || unit.unit.endsWith("15")) { config['www.liveatmidtownarlington.com'].unitsArr[i] = { ...config['www.liveatmidtownarlington.com'].unitsArr[i], floorplanImg: 'https://assets-global.website-files.com/6417a1936e627e04871b7c48/64180ac06288399d004128d8_2x2.png', bed: 2, bath: 2, sqft: 878, rent: 850 }; } } for (var i = 0; i < config['www.liveatlibertylofts.com'].unitsArr.length; i++) { config['www.liveatlibertylofts.com'].unitsArr[i] = { ...config['www.liveatlibertylofts.com'].unitsArr[i], floorplanImg: 'https://assets-global.website-files.com/6412a9cdaf8d7567350bd1eb/6412bbd7bb057cb3becdef57_3bedroom.jpeg', bed: 3, bath: 3, sqft: 1200 }; } for (var i = 0; i < config['www.theedgeattech.com'].unitsArr.length; i++) { var unit = config['www.theedgeattech.com'].unitsArr[i]; if (unit.unit.startsWith("A") || unit.unit.startsWith("E") || unit.unit.startsWith("G") || unit.unit.startsWith("H")) { config['www.theedgeattech.com'].unitsArr[i] = { ...config['www.theedgeattech.com'].unitsArr[i], floorplanImg: 'https://assets-global.website-files.com/6408025089e97ef5c321496a/64083e1e64ee2ed524ad7883_4%20Bedroom%3A%204%20Bathroom-p-1080.jpeg', bed: 4, bath: 4, sqft: 0 }; } else { config['www.theedgeattech.com'].unitsArr[i] = { ...config['www.theedgeattech.com'].unitsArr[i], floorplanImg: 'https://assets-global.website-files.com/6408025089e97ef5c321496a/64083e2b1004c5d9de2cffa9_2%20Bedroom%3A%202%20Bathroom-p-1080.jpeg', bed: 2, bath: 2, sqft: 0 }; } } if (config[canonicalUrl]) { return {...baseConfig, ...config[canonicalUrl]}; } return baseConfig; } BeansPlatformr.prototype.checkAndGetData = function(addressFromRequest) { var so = this; if (beansUrlParameter('getData') === 'true' || window.location.hash === '#/getData') { } } BeansPlatformr.prototype.render = function(be1, urlFromRequest, renderType) { var so = this; var config = so.getConfigFromUrl(urlFromRequest); var address = config.address; var DONE = 4; // readyState 4 means the request is done. var OK = 200; // status 200 is a successful return. var renderWithUnits = function(unitsArr) { var addressAndUnitWithOptions = convertUnitsArr(config, unitsArr, true); var displayOptions = getDisplayOptions( config, { fillColor: '#EAD6C3', fillOpacity: 0.2, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, // Default color { fillColor: '#CDA349', }, // Selected color { fillColor: '#3F1F08', } // Selectable color ); if (!renderType || renderType.toLowerCase() === '3d') { console.log('3D'); be1.render( "body-inner-1", "331c3493f6d3438:3538613337656665626235363439336638376463", addressAndUnitWithOptions, { hideNavigateButton: true, hideMyLocationButton: true }, { beansMapType: 'ESRI', initialMap: 'STREET', prettyLayer: config.prettyLayer ? config.prettyLayer : '', // "https://basemaps.arcgis.com/arcgis/rest/services/OpenStreetMap_v2/VectorTileServer" modernButtons: true, modernBeansCard: displayOptions.hideBeansCard ? false : true, outsideButtons: true, showCompass: true, showFullScreenMode: false, showNeighbors: false, showPOIButton: true, showSeparateFacilitiesCard: true, immersiveConfig: config.immersiveConfig, showImmersive: config.showImmersive, showImmersiveBalloons: config.showImmersiveBalloons, showImmersiveLight: config.showImmersiveLight, showImmersiveOnLoad: config.showImmersiveOnLoad, overrideBaseHeightFn: config.overrideBaseHeightFn, overrideHeight: config.overrideHeight ? config.overrideHeight : 0, overrideHeightFn: config.overrideHeightFn, renameAmenities: config.renameAmenities ? config.renameAmenities : null, poiShape: config.poiShape, initialTilt: 30, initialZ: 400, initialHeading: 270, initialPosition: { address: address }, show2DButton: true, event2D: () => { document.getElementById('body-inner-2').style.visibility = 'visible'; document.getElementById('body-inner-1').style.visibility = 'hidden'; }, ...displayOptions } ); } else { console.log('2D'); if (displayOptions.unitShape) { displayOptions.unitShape.fillOpacity = 1.0; } be1.render( "body-inner-2", "331c3493f6d3438:3538613337656665626235363439336638376463", addressAndUnitWithOptions, { hideNavigateButton: true, hideMyLocationButton: true }, { initialMap: "STREET", modernBeansCard: displayOptions.hideBeansCard ? false : true, hideFloorSelector: false, hideRotateControl: true, hideSatelliteButton: true, hideShadow: true, outsideButtons: true, modernButtons: true, showNeighbors: false, showPOIButton: false, showSeparateFacilitiesCard: true, showNumbers: true, numbersConfig: config.numbersConfig, showBuildingShape: config.showBuildingShape, backgroundImage: config.backgroundImage, show3DButton: true, event3D: () => { document.getElementById('body-inner-2').style.visibility = 'hidden'; document.getElementById('body-inner-1').style.visibility = 'visible'; }, unitsToExclude: config.unitsToExclude, ...displayOptions } ); } }.bind(this); if (config.data) { fetch('https://www.beans.ai/mapswidget/client/platformr-data.json') .then(response => response.json()) .then(json => { var unitsArr = []; for (var u in json) { if (u.indexOf(config.canonicalUrl) !== -1) { for (var i in json[u]) { var y = json[u][i]; if (!y.Workflow) { continue; } var x = y.Workflow; if (!x.ActivityGroups) { continue; } for (var j in x.ActivityGroups) { if (!x.ActivityGroups[j].GroupActivities) { continue; } for (var k in x.ActivityGroups[j].GroupActivities) { if (!x.ActivityGroups[j].GroupActivities[k].Units) { continue; } var fpArr = x.ActivityGroups[j].GroupActivities[k].Units; for (var h in fpArr) { unitsArr.push({ unit: fpArr[h].UnitNumber, bed: x.ActivityGroups[j].GroupActivities[k].Floorplan.Bedrooms ? x.ActivityGroups[j].GroupActivities[k].Floorplan.Bedrooms : 0, bath: x.ActivityGroups[j].GroupActivities[k].Floorplan.Bathrooms ? x.ActivityGroups[j].GroupActivities[k].Floorplan.Bathrooms : 0, sqft: fpArr[h].Squarefeet ? fpArr[h].Squarefeet : 0, availability: fpArr[h].AvailableDateString, rent: fpArr[h].MinPriceRange, link: config.link }); } } } } } } renderWithUnits(unitsArr); }); } else if (config.unitsArr) { renderWithUnits(config.unitsArr); } else if (config.siteId) { var xhr = new XMLHttpRequest(); xhr.open('GET', 'https://api.ws.realpage.com/v2/property/' + config.siteId + '/units?available=true&honordisplayorder=true&siteid=' + config.siteId + '&bestprice=true&leaseterm=3,4,5,6,7,8,9,10,11,12,13,14,15&dateneeded=2024-03-11'); xhr.setRequestHeader('Content-Type', 'APPLICATION/JSON; CHARSET=UTF-8'); xhr.setRequestHeader('X-Ws-Authkey', config.apiKey); xhr.onreadystatechange = function() { if (xhr.readyState !== DONE || xhr.status !== OK) { return; } json = JSON.parse(xhr.responseText); var unitsArr = []; if (!config.placeHolder && json.response.units) { for (var i in json.response.units) { var obj = json.response.units[i]; var unit = obj.name; var beds = obj.numberOfBeds; var baths = obj.numberOfBaths; var sqft = obj.squareFeet; var rent = obj.rent; unitsArr.push({ unit: unit, bed: beds, bath: baths, sqft: sqft, rent: rent, // link: 'https://' + config.canonicalUrl + '/Apartments/module/application_authentication/popup/false/kill_session/1/property[id]/%20' + pp + '/property_floorplan[id]/' + fp + '/unit_space[id]/' + up + '/show_in_popup/false/from_check_availability/1' }); } } renderWithUnits(unitsArr); }.bind(this); xhr.send(); } else if (config.locationUrl) { var DONE = 4; // readyState 4 means the request is done. var OK = 200; // status 200 is a successful return. var xhr = new XMLHttpRequest(); // xhr.open('POST', 'https://inventory.g5marketingcloud.com/graphql'); xhr.open('GET', 'https://www.beans.ai/mapswidget/client/graphql.php?property_id=' + config.canonicalUrl + '&location=' + config.locationUrl + '&force=' + (beansUrlParameter('force') ? beansUrlParameter('force') : '')); xhr.onreadystatechange = function() { if (xhr.readyState !== DONE || xhr.status !== OK) { return; } json = JSON.parse(xhr.responseText); if (json.data && json.data.apartmentComplex && json.data.apartmentComplex.floorplans) { var floorplans = []; for (var i = 0; i < json.data.apartmentComplex.floorplans.length; i++) { floorplans.push(json.data.apartmentComplex.floorplans[i]); } var recurse = function(floorplans, unitsArr, callback) { if (floorplans.length === 0) { callback(unitsArr); return; } var xhrI = new XMLHttpRequest(); xhrI.open('GET', 'https://www.beans.ai/mapswidget/client/graphqlfp.php?property_id=' + config.canonicalUrl + '&location=' + config.locationUrl + '&floorplan_id=' + floorplans[0].id + '&force=' + (beansUrlParameter('force') ? beansUrlParameter('force') : '')); xhrI.onreadystatechange = function() { if (xhrI.readyState !== DONE || xhrI.status !== OK) { return; } var jsonI = JSON.parse(xhrI.responseText); if (jsonI.data && jsonI.data.units) { for (var i = 0; i < jsonI.data.units.length; i++) { var unitObj = jsonI.data.units[i]; var lnk = unitObj.callToActions && unitObj.callToActions.length ? unitObj.callToActions[0].url : ''; lnk = lnk.replace('{widget.moveInDate.YYYY-MM-DD}', unitObj.availabilityDate ? unitObj.availabilityDate : ''); var unit = unitObj.name; if (config.unitTransformer) { unit = config.unitTransformer(unitObj.building, unitObj.name); } unitsArr.push({ unit: unit, bed: floorplans[0].beds, bath: floorplans[0].baths, floorplan: floorplans[0].name, sqft: Number(floorplans[0].sqftDisplay.replace(/[^0-9\.]/, '')), rent: unitObj.prices && unitObj.prices.length ? unitObj.prices[0].value : 0, availability: unitObj.availabilityDate ? unitObj.availabilityDate : '', link: lnk, floorplanImg: floorplans[0].imageUrl }); } } floorplans.splice(0, 1); recurse(floorplans, unitsArr, callback); }; xhrI.send(); }; recurse(floorplans, [], (unitsArr) => { var addressAndUnitWithOptions = convertUnitsArr(config, unitsArr, true); for (var i = 0; i < addressAndUnitWithOptions.length; i++) { addressAndUnitWithOptions[i].options.markers = { display: false }; addressAndUnitWithOptions[i].options.poi = [{ name: 'ALL', display: false }]; } renderWithUnits(unitsArr); }); } }; xhr.send(); } else if (config.propertyId) { var DONE = 4; // readyState 4 means the request is done. var OK = 200; // status 200 is a successful return. var xhr = new XMLHttpRequest(); xhr.open('GET', 'https://www.beans.ai/mapswidget/client/entrata?dom=passcocompanies&propertyId=' + config.propertyId + '&force=' + (beansUrlParameter('force') ? beansUrlParameter('force') : '')); xhr.setRequestHeader('Content-Type', 'APPLICATION/JSON; CHARSET=UTF-8'); xhr.setRequestHeader('X-Api-Key', '28f71a3b-0925-41be-b71a-3b092501be14'); xhr.onreadystatechange = function() { if (xhr.readyState !== DONE || xhr.status !== OK) { return; } json = JSON.parse(xhr.responseText); var floorplans = {}; if (json.response.result && json.response.result.Properties) { for (var i in json.response.result.Properties.Property[0].Floorplans.Floorplan) { var fp = json.response.result.Properties.Property[0].Floorplans.Floorplan[i]; var val = '' + fp.Identification.IDValue; var beds = 0; var baths = 0; var sqft = 0; for (var j in fp.Room) { var rm = fp.Room[j]; if (rm['@attributes']['RoomType'] === 'Bedroom') { beds = rm.Count; } if (rm['@attributes']['RoomType'] === 'Bathroom') { baths = rm.Count; } } if (fp.SquareFeet && fp.SquareFeet['@attributes'] && fp.SquareFeet['@attributes'].Min) { sqft = fp.SquareFeet['@attributes'].Min; } else if (fp.SquareFeet && fp.SquareFeet['@attributes'] && fp.SquareFeet['@attributes'].Max) { sqft = fp.SquareFeet['@attributes'].Max; } else if (fp.SquareFeet && fp.SquareFeet['@attributes'] && fp.SquareFeet['@attributes'].Avg) { sqft = fp.SquareFeet['@attributes'].Avg; } floorplans[val] = { beds: beds, baths: baths, sqft: sqft }; } } var unitsArr = []; if (!config.placeHolder && json.response.result && json.response.result.ILS_Units) { for (var i in json.response.result.ILS_Units.Unit) { var obj = json.response.result.ILS_Units.Unit[i]; if (!obj['@attributes']['Availability'] || obj['@attributes']['Availability'] !== 'Available') { continue; } var availability = 'Now'; if (obj['@attributes']['AvailableOn']) { availability = ' from ' + obj['@attributes']['AvailableOn']; } var pp = '' + obj['@attributes']['PropertyId']; var up = '' + obj['@attributes']['PropertyUnitId']; var fp = '' + obj['@attributes']['FloorplanId']; var beds = 0; var baths = 0; var sqft = 0; var rent = 0; if (obj.Rent && obj.Rent['@attributes'].MinRent) { rent = Number(obj.Rent['@attributes'].MinRent.replace(/[^0-9\.]/, '')); } else if (obj.Rent && obj.Rent['@attributes'].MaxRent) { rent = Number(obj.Rent['@attributes'].MaxRent.replace(/[^0-9\.]/, '')); } if (floorplans[fp]) { beds = floorplans[fp].beds; baths = floorplans[fp].baths; sqft = floorplans[fp].sqft; } var un = obj['@attributes']['UnitNumber']; if (obj['@attributes']['BuildingName']) { if (obj['@attributes']['BuildingName'].indexOf(' ') !== -1) { un = obj['@attributes']['BuildingName'] + '||' + un; } else { un = obj['@attributes']['BuildingName'] + '-' + un; } } unitsArr.push({ unit: un, bed: beds, bath: baths, sqft: sqft, availability: availability, rent: rent, link: 'https://' + config.canonicalUrl + '/Apartments/module/application_authentication/popup/false/kill_session/1/property[id]/%20' + pp + '/property_floorplan[id]/' + fp + '/unit_space[id]/' + up + '/show_in_popup/false/from_check_availability/1' }); } } renderWithUnits(unitsArr); }; xhr.send(); } else { renderWithUnits([]); } }