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 } ]; } if (unitsArr[i].floorplan) { onPreviewData.push({ value: unitsArr[i].floorplan, icon: 'floorplan' }); } 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, // floorplan: unitsArr[i].floorplan, 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, hideBeansCard: config.hideBeansCard, standaloneFilters: config.standaloneFilters, overrideHeight: config.overrideHeight, amenityPopupHeight: config.amenityPopupHeight, iconSizeMultiplier: config.iconSizeMultiplier, showUnitList: true, showUnitShape: true, outsideButtons: true, showDirections: false, showPath: false, propertyId: config.propertyId, propertyIdUrl: config.propertyIdUrl, pricing: config.pricing, showPricingAsDropdown: config.showPricingAsDropdown, colorsConfig: config.colorsConfig, 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, }; } var renderWithUnits = function(be1, renderType, config, address, unitsArr) { var addressAndUnitWithOptions = convertUnitsArr(config, unitsArr, true); if (!renderType || renderType.toLowerCase() === '3d') { 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 ); 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 { config.unitShape = null; var displayOptions = getDisplayOptions( config, { fillColor: '#FFFFFF', fillOpacity: 1.0, strokeWeight: 0.5, strokeOpacity: 1.0, strokeColor: '#000000' }, // Default color { fillColor: '#CDA349', }, // Selected color { fillColor: '#3F1F08', } // Selectable color ); 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 } ); } }; 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"] = { isEntrataData: true, propertyId: "1128695", entrataDomain: "passcocompanies", 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', }, }; config["www.chenalcommonsapts.com"] = { isGraphqlData: true, locationUrl: "g5-cl-1oi6w4wbte-huffjones-management-co-little-rock-ar", 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"] = { isEntrataData: true, propertyId: "100085807", entrataDomain: "passcocompanies", 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', }, }; 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() { var so = this; if (beansUrlParameter('getData') === 'true') { so.getFloorPlans(); } } BeansPlatformr.prototype.render = function(be1, urlFromRequest, renderType) { var so = this; var config = so.getConfigFromUrl(urlFromRequest); var address = config.address; if (config.unitsArr) { renderWithUnits(be1, renderType, config, address, config.unitsArr); } else if (config.isEntrataData) { fetch('https://www.beans.ai/mapswidget/client/entrata?dom=' + config.entrataDomain + '&propertyId=' + config.propertyId, { headers: { 'Content-Type': 'APPLICATION/JSON; CHARSET=UTF-8', 'X-Api-Key': '28f71a3b-0925-41be-b71a-3b092501be14' } } ) .then(response => response.json()) .then(json => { var floorplans = {}; if (json.response && 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 && 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(be1, renderType, config, address, unitsArr); }); } else if (config.isAtlanticData) { fetch('https://www.beans.ai/mapswidget/client/atlantic-data.json') .then(response => response.json()) .then(json => { var unitsArr = []; for (var i in json) { if (i.indexOf(config.canonicalUrl) !== -1) { var x = JSON.parse(json[i]); for (var j = 0; j < x.length; j++) { if (!x[j].units || x[j].units.length === 0) { continue; } for (var k = 0; k < x[j].units.length; k++) { var av = x[j].units[k].available; if (av.indexOf('/') !== -1) { var m = String(av.split('/')[0]).padStart(2, '0'); var d = String(av.split('/')[1]).padStart(2, '0'); var y = av.split('/')[2]; av = y + '-' + m + '-' + d; } var unit = x[j].units[k]['unit']; var beds = x[j].beds ? x[j].beds : 0; var baths = x[j].baths ? x[j].baths : 0; var sqft = x[j].units[k]['area']; var rent = x[j].units[k]['rent']; var floorplan = x[j].name; var floorplanImg = x[j].img ? x[j].img : ''; var avail = av; var link = config.rentcafeLink + '&FloorPlanID=' + x[j].id + '&UnitID=' + x[j].units[k].id + '&MoveInDate=' + x[j].units[k].available; unitsArr.push({ unit: unit, bed: beds, bath: baths, sqft: sqft, rent: rent, floorplan: floorplan, link: link, floorplanImg: floorplanImg, availability: avail}); } } } } renderWithUnits(be1, renderType, config, address, unitsArr); }); } else if (config.isYardiData) { fetch('https://www.beans.ai/mapswidget/client/' + config.yardiDomain + '-data.json') .then(response => response.json()) .then(json => { var unitsArr = []; for (var i in json) { if (i.indexOf(config.canonicalUrl) !== -1) { var x = JSON.parse(json[i]); for (var j = 0; j < x.length; j++) { for (var k = 0; k < x[j].units.length; k++) { var unit = x[j].units[k]['unit']; var unitData = x[j].units[k]['data']; var y = /.*'(.*)', '(.*)', '(.*)', '(.*)', '(.*)', '(.*)'.*/.exec(unitData); var beds = x[j].beds ? x[j].beds : 0; var baths = x[j].baths ? x[j].baths : 0; var sqft = 0; var rent = 0; floorplanImg = x[j].img ? x[j].img : ''; if (y) { sqft = Number(y[3]); rent = Number(y[4]); } var avail = ''; if (x[j].units[k]['link']) { var ix = x[j].units[k]['link'].lastIndexOf('='); if (ix !== -1) { avail = x[j].units[k]['link'].substring(ix + 1); if (avail.indexOf('&') !== -1) { avail = avail.substring(0, avail.indexOf('&')); } } } if (address == '200 NW 2nd St, Waukee, IA' && avail) { monthAvail = Number(avail.split('/')[0]); var currentMonth = new Date().getMonth() + 1; if (monthAvail <= currentMonth) { unitsArr.push({ unit: unit, bed: beds, bath: baths, sqft: sqft, rent: rent, link: x[j].units[k]['link'] ,floorplanImg: floorplanImg, availability: avail}); } } else { unitsArr.push({ unit: unit, bed: beds, bath: baths, sqft: sqft, rent: rent, link: x[j].units[k]['link'] ,floorplanImg: floorplanImg, availability: avail}); } } } } } renderWithUnits(be1, renderType, config, address, unitsArr); }); } else if (config.isTurboTenantData) { fetch('https://www.beans.ai/mapswidget/client/graphqlturbo?property_id=' + config.propertyId) .then(response => response.json()) .then(json => { var unitsArr = []; if (json.data && json.data.viewer && json.data.viewer.ownerListings) { for (var i in json.data.viewer && json.data.viewer.ownerListings) { var obj = json.data.viewer.ownerListings[i]; var unit = obj.unit; var address = obj.address; if (address.indexOf(' ') !== -1) { address = address.split(' ')[0]; } if (address.indexOf('Rudder') !== -1) { address = address + 'R'; } unit = address + '-' + unit; unitsArr.push({ unit: unit, bed: obj.details.property_details.bedrooms, bath: obj.details.property_details.bathrooms, sqft: obj.details.property_details.square_feet, availability: 'Now', rent: obj.rent_amount, link: 'https://renter.turbotenant.com/applications/' + obj.id }); } } renderWithUnits(be1, renderType, config, address, unitsArr); }); } else if (config.isGraphqlData) { fetch('https://www.beans.ai/mapswidget/client/graphql.php?property_id=' + config.canonicalUrl + '&location=' + config.locationUrl + '&force=' + (beansUrlParameter('force') ? beansUrlParameter('force') : '')) .then(response => response.json()) .then(json => { 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 unitsArr = []; var proms = []; for (var i = 0; i < floorplans.length; i++) { const floorplan = floorplans[i]; proms.push( fetch('https://www.beans.ai/mapswidget/client/graphqlfp.php?property_id=' + config.canonicalUrl + '&location=' + config.locationUrl + '&floorplan_id=' + floorplan.id + '&force=' + (beansUrlParameter('force') ? beansUrlParameter('force') : '')) .then(response => response.json()) .then(jsonI => { 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 : ''); unitsArr.push({ unit: unitObj.name, bed: floorplan.beds, bath: floorplan.baths, floorplan: floorplan.name, sqft: unitObj.sqftDisplay ? Number(unitObj.sqftDisplay.replace(/[^0-9\.]/, '')) : floorplan.sqft, rent: unitObj.prices && unitObj.prices.length ? unitObj.prices[0].value : 0, availability: unitObj.availabilityDate ? unitObj.availabilityDate : '', link: lnk, floorplanImg: floorplan.imageUrl }); } } }) ); } Promise.all(proms).then((values) => { renderWithUnits(be1, renderType, config, address, unitsArr); }); } else { renderWithUnits(be1, renderType, config, address, []); } }); } else if (config.isAppfolioData) { fetch('https://www.beans.ai/mapswidget/client/appfolio.php?propertyId=' + config.propertyId + '&url=' + urlFromRequest) .then(response => response.json()) .then(json => { var unitsArr = []; for (var k = 0; k < json.values.length; k++) { var unit = json.values[k].data.address_address1; var beds = json.values[k].data.bedrooms; var baths = json.values[k].data.bathrooms; var sqft = json.values[k].data.square_feet; var rent = json.values[k].data.market_rent; var avail = json.values[k].data.available_date; unitsArr.push({ unit: unit, bed: beds, bath: baths, sqft: sqft, rent: rent, link: '' ,floorplanImg: '', availability: avail}); } renderWithUnits(be1, renderType, config, address, unitsArr); }); } else if (config.isQuickbaseData) { fetch('https://www.beans.ai/mapswidget/client/perry-data.json') .then(response => response.json()) .then(json => { var unitsArr = []; var x = json[config.propertyId]; if (x) { for (var j = 0; j < x.length; j++) { if (!x[j].Available) { continue; } var unit = x[j].Unit; var beds = x[j].Bedrooms ? x[j].Bedrooms : 0; var baths = x[j].Bathrooms ? x[j].Bathrooms : 0; var sqft = x[j].SqFt ? x[j].SqFt : 0; var rent = x[j].Rent ? Number(x[j].Rent.replace(',', '')) : 0; var floorplan = x[j].Model ? x[j].Model : ''; unitsArr.push({ unit: unit, bed: beds, bath: baths, sqft: sqft, rent: rent, link: '' ,floorplan: floorplan, availability: ''}); } } renderWithUnits(be1, renderType, config, address, unitsArr); }); } else if (config.isGisData) { fetch('https://gis-server.beans.ai/arcgis/rest/services/Hosted/' + config.gisDomain + '/FeatureServer/0/query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&defaultSR=&spatialRel=esriSpatialRelIntersects&distance=&units=esriSRUnit_Foot&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&havingClause=&gdbVersion=&historicMoment=&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=xyFootprint&resultOffset=&resultRecordCount=&returnTrueCurves=false&returnCentroid=false&timeReferenceUnknownClient=false&maxRecordCountFactor=&sqlFormat=none&resultType=&datumTransformation=&lodType=geohash&lod=&lodSR=&f=pjson') .then(response => response.json()) .then(json => { var unitsArr = []; if (json.features) { for (var i = 0; i < json.features.length; i++) { if (!config.addressList[json.features[i].attributes.address]) { continue; } if (json.features[i].attributes.availability !== 'Available') { continue; } var type = json.features[i].attributes.type ? json.features[i].attributes.type : ''; var bedrooms = 0; var bathrooms = 0; if (type === 'Studio') { bathrooms = 1; } else { var y = /.*([0-9+]) Bed.*/.exec(type); if (y) { bedrooms = Number(y[1]); } var z = /.*([0-9+]) Bath.*/.exec(type); if (z) { bathrooms = Number(z[1]); } } var unit = '' + json.features[i].attributes.unit; var bldg = '' + json.features[i].attributes.address.substring(0, json.features[i].attributes.address.indexOf(' ')); if (!config.skipBuildingNumberinSearch) { unit = bldg + '-' + unit; } var floorplan = json.features[i].attributes.floor_plan_name ? json.features[i].attributes.floor_plan_name : ''; floorplan = floorplan.trim(); var floorplanImg = ''; if (floorplan) { if (floorplan.toLowerCase() === 'ace' || floorplan.toLowerCase() === 'aviator' || floorplan.toLowerCase() === 'bandit' || floorplan.toLowerCase() === 'baron' || floorplan.toLowerCase() === 'captain' || floorplan.toLowerCase() === 'clipper' || floorplan.toLowerCase() === 'curve' || floorplan.toLowerCase() === 'lookout' || floorplan.toLowerCase() === 'traveler' || floorplan.toLowerCase() === 'surge' || floorplan.toLowerCase() === 'alley-oop' || floorplan.toLowerCase() === 'assist' || floorplan.toLowerCase() === 'baseline' || floorplan.toLowerCase() === 'fast break' || floorplan.toLowerCase() === 'free throw' || floorplan.toLowerCase() === 'shot clock' || floorplan.toLowerCase() === 'slam dunk' || floorplan.toLowerCase() === 'swish' || floorplan.toLowerCase() === 'tip off') { floorplanImg = 'https://www.beans.ai/mapswidget/client/mfpro-images/' + floorplan.toLowerCase() + '.png'; } } var link = json.features[i].attributes.learn_more__url ? json.features[i].attributes.learn_more__url : ''; unitsArr.push({ unit: unit, bed: bedrooms, bath: bathrooms ? bathrooms : 1, sqft: json.features[i].attributes.sqft ? json.features[i].attributes.sqft : 0, rent: json.features[i].attributes.price ? json.features[i].attributes.price : 0, floorplan: floorplan, floorplanImg: floorplanImg, link: link }); } } renderWithUnits(be1, renderType, config, address, unitsArr); }); } else if (config.knockrentalPropertyId) { fetch('https://doorway-api.knockrentals.com/v1/property/' + config.knockrentalPropertyId + '/units') .then(response => response.json()) .then(jsonKnock => { var buildings = {}; if (jsonKnock.units_data && jsonKnock.units_data.buildings) { for (var i = 0; i < jsonKnock.units_data.buildings.length; i++) { var unitObj = jsonKnock.units_data.buildings[i]; if (!unitObj.name || !unitObj.id) { continue; } buildings[unitObj.id] = jsonKnock.units_data.buildings[i]; } } var layouts = {}; if (jsonKnock.units_data && jsonKnock.units_data.layouts) { for (var i = 0; i < jsonKnock.units_data.layouts.length; i++) { var unitObj = jsonKnock.units_data.layouts[i]; if (!unitObj.name || !unitObj.id) { continue; } layouts[unitObj.id] = jsonKnock.units_data.layouts[i]; } } var unitsArr = []; if (jsonKnock.units_data && jsonKnock.units_data.units) { for (var i = 0; i < jsonKnock.units_data.units.length; i++) { var unitObj = jsonKnock.units_data.units[i]; if (!unitObj.available) { continue; } var unit = unitObj.name; if (unitObj.buildingId && buildings[unitObj.buildingId] && buildings[unitObj.buildingId].name) { unit = buildings[unitObj.buildingId].name + '-' + unit; } // if (!config.unitsData[unit]) { // continue; // } var beds = unitObj.bedrooms; var baths = unitObj.bathrooms; var sqft = unitObj.area; var rent = unitObj.displayPrice; var link = 'https://' + config.realpagePropertyId + '.onlineleasing.realpage.com/?UnitId='; var floorplan = unitObj.layoutName; var floorplanImg = layouts[unitObj.layoutId].img; var avail = unitObj.availableOn; unitsArr.push({unit: unit, bed: beds, bath: baths, sqft: sqft, rent: rent, link: link, floorplan: floorplan, floorplanImg: floorplanImg, availability: avail}); } } renderWithUnits(be1, renderType, config, address, unitsArr); }); } else { renderWithUnits(be1, renderType, config, address, []); } }