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", "bf7e8662c3524dd:6164366434383862653234313432656139643166", 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", "bf7e8662c3524dd:6164366434383862653234313432656139643166", 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 BeansTrilogy = function() { }; BeansTrilogy.prototype.getConfigFromUrl = function(urlFromRequest) { var canonicalUrl = urlFromRequest ? urlFromRequest : window.location.hostname; if (canonicalUrl === 'www.livetrilogy.com') { if (window.location.href.indexOf('/the-hallon-ii/') !== -1) { canonicalUrl = 'www.thehallon8490.com'; } if (window.location.href.indexOf('/the-hallon-i/') !== -1) { canonicalUrl = 'www.thehallon8594.com'; } } if (beansUrlParameter('canonicalUrl')) { canonicalUrl = beansUrlParameter('canonicalUrl'); } var baseConfig = getBaseConfig(canonicalUrl); var config = {}; config["www.livemirada.com"] = { isYardiData: true, yardiDomain: "", backgroundImage: { src: '/mapswidget/prettymaps/1mirada.png', width: '2368px', height: '4072px', position: { lat: 40.144196095049445, lng: -83.0177031983588, lat2: 40.140854796225575, lng2: -83.01508356104106, } }, camera: {tilt: 52.942206349421475, heading: 124.08795068492267, position: {x: -83.01883798597497, y: 40.14379697935293, z: 177.5535047147423}}, address: "1 Mirada N Dr, Lewis Center, OH", numbersConfig: { size: 30, convert: (a) => { if (!a) { return a; } if (a.indexOf('-') !== -1) { a = a.substring(a.indexOf('-') + 1); } a = a.replace(/[A-Z]/g, ''); a = a.replaceAll('_', '\n'); return a; } }, unitsToExclude: ['FITNESS', 'CLUB', 'BUSINESS', 'PUTTING', 'HOT', 'STORAGE', 'POOL', 'COURT', 'OFFICE', 'TENNIS', 'BBQ', 'TRASH', 'CAR', 'MAIL', 'DOG', 'VOLLEY'], }; config["www.riversetapts.com"] = { isYardiData: true, yardiDomain: "", backgroundImage: { src: '/mapswidget/prettymaps/100riverset.png', width: '1192px', height: '2454px', position: { lat: 35.17745806040488, lng: -90.05540718453583, lat2: 35.171093626506514, lng2: -90.05153906387355, } }, camera: {tilt: 64.89595642537357, heading: 336.63719027172533, position: {x: -90.05088315301387, y: 35.168282116256094, z: 276.7431051740423}}, address: "100 Riverset Ln, Memphis, TN", numbersConfig: { size: 10, convert: (a) => { if (!a) { return a; } if (a.indexOf('-') !== -1) { a = a.substring(a.indexOf('-') + 1); } a = a.replaceAll('_', '\n'); return a; } }, unitsToExclude: ['FITNESS', 'CLUB', 'BUSINESS', 'PUTTING', 'HOT', 'STORAGE', 'POOL', 'COURT', 'OFFICE', 'TENNIS', 'BBQ', 'TRASH', 'CAR', 'MAIL'], }; config["www.villasatmainstreet.com"] = { isYardiData: true, yardiDomain: "", backgroundImage: { src: '/mapswidget/prettymaps/101lakevillage.png', width: '1722px', height: '1300px', position: { lat: 42.25220600185376, lng: -83.7499989412723, lat2: 42.24912721216406, lng2: -83.74441201245193, } }, camera: {tilt: 40.81485762253729, heading: 150.13696836588016, position: {x: -83.7494395812328, y: 42.254134390389325, z: 444.4794311756268}}, address: "101 Lake Village Dr, Ann Arbor, MI", numbersConfig: { size: 11, convert: (a) => { if (!a) { return a; } if (a.indexOf('-') !== -1) { a = a.substring(a.indexOf('-') + 1); } return a; } }, unitsToExclude: ['OFFICE', 'OUTDOOR', 'GRILL', 'WFH', 'GYM', 'SAUNA', 'SPIN', 'SPA', 'GARAGE', 'LOUNGE', 'GAME', 'POOL', 'CABANA', 'TRASH', 'BATHROOM', 'DOG', 'GYM', 'FITNESS', 'COFFEE', 'BUSINESS', 'GAZEBO', 'CARPORT', 'MAIL', 'PATIO', 'PACKAGE', 'CLUB', 'MAINTENANCE', 'FIRE'], }; config["www.livecentralpark.com"] = { isYardiData: true, yardiDomain: "", backgroundImage: { src: '/mapswidget/prettymaps/105radiocity.png', width: '3654px', height: '2067px', position: { lat: 40.12152814141454, lng: -83.01642974305957, lat2: 40.11949575004621, lng2: -83.01184765300425, } }, camera: {tilt: 36.301549983612375, heading: 3.016809229200494, position: {x: -83.01407459472539, y: 40.11810764085087, z: 320.7608755622059}}, address: "105 Radio City Blvd, Columbus, OH", numbersConfig: { size: 20, convert: (a) => { if (!a) { return a; } if (a.indexOf('-') !== -1) { a = a.substring(0, a.indexOf('-')); } a = a.replace(/[A-Z]/g, ""); return a; } }, unitsToExclude: ['OFFICE', 'OUTDOOR', 'GRILL', 'WFH', 'GYM', 'SAUNA', 'SPIN', 'SPA', 'GARAGE', 'LOUNGE', 'GAME', 'POOL', 'CABANA', 'TRASH', 'BATHROOM', 'DOG', 'GYM', 'FITNESS', 'COFFEE', 'BUSINESS', 'GAZEBO', 'CARPORT', 'MAIL', 'PATIO', 'PACKAGE', 'CLUB', 'MAINTENANCE', 'FIRE'], }; config["www.reflectioncoveapts.com"] = { isYardiData: true, yardiDomain: "", backgroundImage: { src: '/mapswidget/prettymaps/13992reflection.png', width: '2344px', height: '1086px', position: { lat: 38.594163863752464, lng: -90.4867788199893, lat2: 38.59231269109612, lng2: -90.48137769011937, } }, camera: {tilt: 35.610656504834196, heading: 0.4464130364564229, position: {x: -90.48367623643614, y: 38.59069196918912, z: 365.77662085182965}}, address: "13992 Reflection Dr, Manchester, MO", numbersConfig: { size: 14, convert: (a) => { if (!a) { return a; } if (a.indexOf('-') !== -1) { a = a.substring(a.indexOf('-') + 1); } a = a.replaceAll('_', ' '); return a; } }, unitsToExclude: ['OFFICE', 'OUTDOOR', 'GRILL', 'WFH', 'GYM', 'SAUNA', 'SPIN', 'SPA', 'GARAGE', 'LOUNGE', 'GAME', 'POOL', 'CABANA', 'TRASH', 'BATHROOM', 'DOG', 'GYM', 'FITNESS', 'COFFEE', 'BUSINESS', 'GAZEBO', 'CARPORT', 'MAIL', 'PATIO', 'PACKAGE', 'CLUB', 'MAINTENANCE', 'FIRE', 'COURTYARD', 'LOBBY', 'GUEST', 'SUN', 'HEARTH'], }; config["www.residencesatthestreets.com"] = { isYardiData: true, yardiDomain: "", camera: {tilt: 39.05342458823349, heading: 301.06229737855597, position: {x: -90.4919718120275, y: 38.76413053345761, z: 272.2339760120958}}, address: "1650 Beale St, Saint Charles, MO", }; config["www.park205.com"] = { isYardiData: true, yardiDomain: "", backgroundImage: { src: '/mapswidget/prettymaps/205wtouhy.png', width: '771px', height: '1617px', position: { lat: 42.01135651503581, lng: -87.82465656548487, lat2: 42.00952403741741, lng2: -87.82338350765048, } }, camera: {tilt: 46.59094437300344, heading: 270.39309897389666, position: {x: -87.8219375504019, y: 42.01043248037349, z: 166.3755940143019}}, address: "205 Touhy Ave, Park Ridge, IL", numbersConfig: { size: 20, convert: (a) => { if (!a) { return a; } if (a.indexOf('-') !== -1) { a = a.substring(0, a.indexOf('-')); } a = a.replaceAll('_', ' '); return a; } }, unitsToExclude: ['OFFICE', 'OUTDOOR', 'GRILL', 'WFH', 'GYM', 'SAUNA', 'SPIN', 'SPA', 'GARAGE', 'LOUNGE', 'GAME', 'POOL', 'CABANA', 'TRASH', 'BATHROOM', 'DOG', 'GYM', 'FITNESS', 'COFFEE', 'BUSINESS', 'GAZEBO', 'CARPORT', 'MAIL', 'PATIO', 'PACKAGE', 'CLUB', 'MAINTENANCE', 'FIRE', 'COURTYARD', 'LOBBY', 'GUEST', 'SUN', 'HEARTH'], }; config["www.parklaureateapts.com"] = { isYardiData: true, yardiDomain: "", backgroundImage: { src: '/mapswidget/prettymaps/2050stony.png', width: '4848px', height: '3428px', position: { lat: 38.218343618316574, lng: -85.60517638731139, lat2: 38.21473684525431, lng2: -85.59874149294312 } }, camera: {tilt: 52.39030959913331, heading: 296.7243078334443, position: {x: -85.59503803793123, y: 38.214075291867616, z: 472.1159800682217}}, address: "2050 Stony Brook Dr, Louisville, KY", numbersConfig: { size: 24 }, unitsToExclude: ['LOUNGE', 'POOL', 'LOBBY', 'TENNIS', 'GRILL', 'GYM', 'TRASH', 'GARAGE', 'MAIL'], }; config["www.nocablu.com"] = { isYardiData: true, yardiDomain: "", camera: {tilt: 51.016857888798704, heading: 144.97711526949558, position: {x: -87.69862037183648, y: 41.9248927783249, z: 87.43719067052007}}, address: "2340 N California Ave, Chicago, IL", }; config["www.livewestlyn.com"] = { isYardiData: true, yardiDomain: "", backgroundImage: { src: '/mapswidget/prettymaps/240thompson.png', width: '1632px', height: '1630px', position: { lat: 44.90158407293216, lng: -93.07654057804959, lat2: 44.89979864751276, lng2: -93.07356954325941, } }, camera: {tilt: 57.61595333668464, heading: 235.22501332187954, position: {x: -93.07363049052593, y: 44.90105430544104, z: 99.30926310736686}}, address: "240 Thompson E Ave, West St Paul, MN", numbersConfig: { size: 20, convert: (a) => { if (!a) { return a; } if (a.indexOf('-') !== -1) { a = a.substring(0, a.indexOf('-')); } a = a.replaceAll('_', ' '); return a; } }, unitsToExclude: ['OFFICE', 'OUTDOOR', 'GRILL', 'WFH', 'GYM', 'SAUNA', 'SPIN', 'SPA', 'GARAGE', 'LOUNGE', 'GAME', 'POOL', 'CABANA', 'TRASH', 'BATHROOM', 'DOG', 'GYM', 'FITNESS', 'COFFEE', 'BUSINESS', 'GAZEBO', 'CARPORT', 'MAIL', 'PATIO', 'PACKAGE', 'CLUB', 'MAINTENANCE', 'FIRE'], }; config["www.azaleatampa.com"] = { isYardiData: true, yardiDomain: "", filters: { bed: { name: 'Bedrooms', values: [ {type: 'all', name: 'Any'}, {type: 'range', value1: '0', value2: '1', name: 'Studio'}, {type: 'range', value1: '1', value2: '2', name: '1BR'}, {type: 'range', value1: '2', value2: '3', name: '2BR'}, {type: 'min', value1: '3', name: '3BR+'} ] }, rent: { name: 'Rent', values: [ {type: 'all', name: 'Any'}, {type: 'range', value1: '0', value2: '1500', name: 'Less than $1,500'}, {type: 'min', value1: '1500', name: '$1,500+'} ] }, sqft: { name: 'Area', values: [ {type: 'all', name: 'Any'}, {type: 'range', value1: '0', value2: '500', name: '0-500'}, {type: 'range', value1: '500', value2: '1000', name: '500-1000'}, {type: 'min', value1: '1000', name: '1000+'} ] } }, backgroundImage: { src: '/mapswidget/prettymaps/2633azalea.png', width: '3316px', height: '2267px', position: { lat: 27.925191685960547, lng: -82.36475651698458, lat2: 27.92248524473886, lng2: -82.36028578321946, } }, camera: {tilt: 56.67967274502346, heading: 180.05656610186492, position: {x: -82.3629241031482, y: 27.926852136325838, z: 240.91029806807637}}, address: "2633 Azalea Garden Pl, Tampa, FL", numbersConfig: { size: 16, convert: (a) => { if (!a) { return a; } if (a.indexOf('-') !== -1) { a = a.substring(a.indexOf('-') + 1); } return a; } }, unitsToExclude: ['OFFICE', 'OUTDOOR', 'GRILL', 'WFH', 'GYM', 'SAUNA', 'SPIN', 'SPA', 'GARAGE', 'LOUNGE', 'GAME', 'POOL', 'CABANA', 'TRASH', 'BATHROOM'], }; config["www.villasatnorthstar.com"] = { isYardiData: true, yardiDomain: "", camera: {tilt: 50.295952502572355, heading: 40.25808782339294, position: {x: -83.70852227500197, y: 42.314127228952394, z: 476.76731388270855}}, address: "2820 Windwood Dr, Ann Arbor, MI", }; config["www.thebohen.com"] = { isYardiData: true, yardiDomain: "", backgroundImage: { src: '/mapswidget/prettymaps/2851hennepin.png', width: '2928px', height: '1288px', position: { lat: 44.95086474775219, lng: -93.2984103554245, lat2: 44.9503621231023, lng2: -93.2968738984809, } }, camera: {tilt: 54.754837024320786, heading: 324.446941506331, position: {x: -93.29670606563234, y: 44.94978783182021, z: 83.79477642010897}}, address: "2851 Hennepin Ave, Minneapolis, MN", showAllBuildingShapes: true, buildingShape: { fillOpacity: 1.0, fillColor: "#FFF", }, numbersConfig: { size: 32, convert: (a) => { if (!a) { return a; } if (a === 'MAILROOM') { return 'MAIL'; } if (a === 'SEATING_AREA') { return 'SEATING'; } if (a === 'CLUBHOUSE') { return 'CLUB'; } if (a === 'ROOFTOP_TERRACE') { return 'TERRACE'; } if (a.indexOf('-') !== -1) { a = a.substring(a.indexOf('-') + 1); } a = a.replaceAll('_', '\n'); return a; } }, unitsToExclude: ['OFFICE', 'OUTDOOR', 'GRILL', 'WFH', 'GYM', 'SAUNA', 'SPIN', 'SPA', 'GARAGE', 'LOUNGE', 'GAME', 'POOL', 'CABANA', 'TRASH', 'BATHROOM'], }; config["www.pointeatstjoseph.com"] = { isYardiData: true, yardiDomain: "", backgroundImage: { src: '/mapswidget/prettymaps/307elaselle.png', width: '3276px', height: '2464px', position: { lat: 41.681100308760185, lng: -86.24937054484012, lat2: 41.67906151527186, lng2: -86.24566862227226, } }, camera: {tilt: 57.62466189854316, heading: 245.633765168896, position: {x: -86.2444793787662, y: 41.680880910114595, z: 154.1817802777514}}, address: "307 E Lasalle Ave, South Bend, IN", numbersConfig: { size: 24, convert: (a) => { if (!a) { return a; } if (a === 'CLUBHOUSE') { return 'CLUB'; } if (a === 'FITNESS_CENTER') { return 'GYM'; } if (a.indexOf('-') !== -1) { a = a.substring(a.indexOf('-') + 1); } a = a.replaceAll('_', '\n'); return a; } }, unitsToExclude: ['OFFICE', 'OUTDOOR', 'GRILL', 'WFH', 'GYM', 'SAUNA', 'SPIN', 'SPA', 'GARAGE', 'LOUNGE', 'GAME', 'POOL', 'CABANA', 'TRASH', 'BATHROOM'], }; config["www.liveatwaterchase.com"] = { isYardiData: true, yardiDomain: "", backgroundImage: { src: '/mapswidget/prettymaps/3100waterchase.png', width: '1198px', height: '2614px', position: { lat: 42.91162653314104, lng: -85.72269032134093, lat2: 42.906530081896435, lng2: -85.71953571031818, } }, camera: {tilt: 37.374191965111905, heading: 267.3312921702587, position: {x: -85.71565360474234, y: 42.909548558834295, z: 558.2194613991305}}, address: "3100 Waterchase SW Way, Wyoming, MI", numbersConfig: { size: 10, convert: (a) => { if (!a) { return a; } if (a === 'CLUBHOUSE') { return 'CLUB'; } if (a === 'FITNESS_CENTER') { return 'GYM'; } if (a.indexOf('-') !== -1) { a = a.substring(a.indexOf('-') + 1); } a = a.replaceAll('_', '\n'); return a; } }, unitsToExclude: ['OFFICE', 'OUTDOOR', 'GRILL', 'WFH', 'GYM', 'SAUNA', 'SPIN', 'SPA', 'GARAGE', 'LOUNGE', 'GAME', 'POOL', 'CABANA', 'TRASH', 'BATHROOM'], }; config["www.bradfordateaston.com"] = { isYardiData: true, yardiDomain: "", backgroundImage: { src: '/mapswidget/prettymaps/4150silversprings.png', width: '2716px', height: '1212px', position: { lat: 40.063752679538094, lng: -82.9161753974101, lat2: 40.06129296050495, lng2: -82.90890777284866, } }, camera: {tilt: 30.280804543446912, heading: 208.582602166817, position: {x: -82.90828533001361, y: 40.06629911479626, z: 915.5455435169861}}, address: "4150 Silver Springs Ln, Columbus, OH", numbersConfig: { size: 9, convert: (a) => { if (!a) { return a; } a = a.replace(/[A-Z-]/g, ""); return a; } }, unitsToExclude: ['OFFICE', 'OUTDOOR', 'GRILL', 'WFH', 'GYM', 'SAUNA', 'SPIN', 'SPA', 'GARAGE', 'LOUNGE', 'GAME', 'POOL', 'CABANA', 'TRASH', 'BATHROOM', 'DOG', 'GYM', 'FITNESS', 'COFFEE', 'BUSINESS', 'GAZEBO'], }; config["www.theviewoncollins.com"] = { isYardiData: true, yardiDomain: "", camera: {tilt: 56.518029053083126, heading: 0.2638372908104707, position: {x: -84.50032378892251, y: 42.68496884975563, z: 237.29650565888733}}, address: "4540 Collins Rd, Lansing, MI", }; config["www.thecommonsatrivertown.com"] = { isYardiData: true, yardiDomain: "", camera: {tilt: 56.44593130230898, heading: 181.88137630635487, position: {x: -85.74052072172226, y: 42.88386338461962, z: 302.4663442829624}}, address: "4702 Rivertown Commons SW Dr, Grandville, MI", }; config["www.xyz.com"] = { isYardiData: true, yardiDomain: "", address: "614 Holleman E Dr, College Station, TX", }; config["www.crescentcentre.com"] = { isYardiData: true, yardiDomain: "", camera: {tilt: 68.29203075347031, heading: 98.51425574131216, position: {x: -85.75944326801958, y: 38.247842556381805, z: 118.89844116196036}}, address: "657 S 3rd St, Lousville, KY", }; config["www.lodgeatoverland.com"] = { isYardiData: true, yardiDomain: "", camera: {tilt: 56.24300772096744, heading: 134.09506388744686, position: {x: -92.5054255815715, y: 44.09806507515425, z: 288.6703298864886}}, address: "6635 Lodge View Rd, Rochester, MN", }; config["www.livevelovillage.com"] = { isYardiData: true, yardiDomain: "", camera: {tilt: 46.41066137184357, heading: 318.5239573685518, position: {x: -88.01735202311156, y: 42.91218577940576, z: 300.6731743067503}}, address: "7235 S Ballpark Dr, Franklin, WI", unitShape: { fillColor: '#D0CABD', fillOpacity: 0.2, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, selectedUnitShape: { fillColor: '#212529', }, selectableUnitShape: { fillColor: '#1376a3', }, }; config["www.theaurilla.com"] = { isYardiData: true, yardiDomain: "", camera: {tilt: 59.26678446992486, heading: 270.72379240842463, position: {x: -92.95764903361086, y: 44.83823645239517, z: 132.22005277406424}}, mobileCamera: {tilt: 0.4999793574397971, heading: 17.97122629868964, position: {x: -92.96036385142429, y: 44.83828554565843, z: 263.38155778776854}}, address: "7689 Hardwood S Ave, Cottage Grove, MN", }; config["www.waterfordliving.com"] = { isYardiData: true, yardiDomain: "", camera: {tilt: 39.35973625518272, heading: 146.68515482770476, position: {x: -89.7955675002388, y: 35.03614236995581, z: 453.45562586560845}}, address: "8037 Waterford Cir, Memphis, TN", }; config["www.thehallon.com"] = { isYardiData: true, yardiDomain: "", camera: {tilt: 63.28582479610514, heading: 350.4160288505781, position: {x: -93.38659626519075, y: 44.92370423256684, z: 152.7963491724804}}, address: "8460 Excelsior Blvd, Hopkins, MN", }; config["www.thehallon8490.com"] = { isYardiData: true, yardiDomain: "", camera: {tilt: 53.41897484069985, heading: 335.08785969968676, position: {x: -93.38537609801305, y: 44.92473841965207, z: 137.84896716848016}}, address: "8490 Excelsior Blvd, Hopkins, MN", }; config["www.thehallon8594.com"] = { isYardiData: true, yardiDomain: "", camera: {tilt: 51.21870300937769, heading: 344.32132453302194, position: {x: -93.38700194166634, y: 44.92451685167442, z: 135.93082429096103}}, address: "8594 Excelsior Blvd, Hopkins, MN", }; config["www.villasatbaileyranch.com"] = { isYardiData: true, yardiDomain: "", camera: {tilt: 55.10601146796335, heading: 126.32589160953981, position: {x: -95.86865245086744, y: 36.282593617592134, z: 294.1148732798174}}, address: "8751 N 97th East Ave, Owasso, OK", }; config["www.kenyonsquareliving.com"] = { isYardiData: true, yardiDomain: "", camera: {tilt: 63.864224446068846, heading: 155.57634080470947, position: {x: -82.97095209783137, y: 40.13805743314267, z: 111.25716891698539}}, address: "9220 Worthington Rd, Westerville, OH", }; config["www.optimaoldorchardwoods.com"] = { isYardiData: true, yardiDomain: "", camera: {tilt: 60.25815554873217, heading: 182.33582306060515, position: {x: -87.7600516061663, y: 42.06012928560808, z: 173.70673177298158}}, address: "9739 Woods Dr, Skokie, IL", }; if (!config[canonicalUrl].canonicalUrl) { config[canonicalUrl].canonicalUrl = canonicalUrl; } if (config[canonicalUrl]) { return {...baseConfig, ...config[canonicalUrl]}; } return baseConfig; } BeansTrilogy.prototype.getFloorPlans = function(callback) { var so = this; var canonicalUrl = so.getConfigFromUrl().canonicalUrl; var queryUrl = canonicalUrl; if (canonicalUrl === 'www.thehallon8594.com') { queryUrl = 'www.livetrilogy.com/the-hallon-i'; } if (canonicalUrl === 'www.thehallon8490.com') { queryUrl = 'www.livetrilogy.com/the-hallon-ii'; } 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://' + queryUrl + '/floorplans', false); xhr.send(); if (xhr.readyState !== DONE || xhr.status !== OK) { return; } var c = xhr.responseText.split('\n'); var floorplansData = []; var imgs = []; var lastKnownImage = ''; for (var i in c) { var j = c[i]; if (j.indexOf('Floor Plan') === -1 && j.indexOf('Floorplan') === -1 && j.indexOf('card-img-top') === -1 && j.indexOf('floorplan-action-button') === -1) { continue; } var y = /.*Floor Plan.*?card-img-top.*?src="(.*?)".*/.exec(j); if (y) { lastKnownImage = y[1]; } if (!y) { y = /.*src="(.*?)".*?card-img-top.*?Floor Plan.*/.exec(j); if (y) { lastKnownImage = y[1]; } } if (!y) { y = /.*src="(.*?)".*?card-img-top.*/.exec(j); if (y) { lastKnownImage = y[1]; } } if (!y) { y = /.*data-selenium-id="Floorplan.*?data-src="(http.*?)".*/.exec(j); if (y) { lastKnownImage = y[1]; } } var y = /.*a href="(.*?)".*floorplan-action-button.*/.exec(j); if (y) { floorplansData.push( { url: y[1], img: lastKnownImage, units: [] } ); lastKnownImage = ''; } } var d = c.join(''); var y = /.*(."@context":.*?)}<\/script>.*/.exec(d); if (y) { var z = '{' + y[1] + '}'; var jo = JSON.parse(z); for (var h = 0; h < jo['accommodationFloorPlan'].length; h++) { floorplansData[h].beds = jo['accommodationFloorPlan'][h]['numberOfBedrooms']; floorplansData[h].baths = jo['accommodationFloorPlan'][h]['numberOfFullBathrooms']; } } for (var i = 0; i < floorplansData.length; i++) { if (floorplansData[i].url.startsWith('https://')) { continue; } var xhr = new XMLHttpRequest(); xhr.open('GET', floorplansData[i].url, false); xhr.send(); if (xhr.readyState !== DONE || xhr.status !== OK) { continue; } var c = xhr.responseText.split('\n'); var z = []; for (var k in c) { var j = c[k]; if (j.indexOf('"url":') !== -1) { mainUrl = j.replaceAll('"url": "', '').replaceAll('"', '').trim(); } if (j.indexOf('applyGAClick') === -1) { continue; } var y = /.*type="button".*?id="(.*?)".*?applyGAClick.(.*?)." href=['"](.*?)['"].*/.exec(j); if (y) { floorplansData[i].units.push({ unit: y[1], data: y[2], link: y[3] }); } } } var data = new FormData(); data.append('url', canonicalUrl); data.append('unit', JSON.stringify(floorplansData)); var xhr = new XMLHttpRequest(); xhr.open('POST', 'https://www.beans.ai/mapswidget/client/trilogy'); xhr.send(data); } BeansTrilogy.prototype.checkAndGetData = function() { var so = this; if (beansUrlParameter('getData') === 'true') { so.getFloorPlans(); } } BeansTrilogy.prototype.render = function(be1, urlFromRequest, renderType) { var so = this; var config = so.getConfigFromUrl(urlFromRequest); var address = config.address; if (!config.isAtlanticData) { if (beansUrlParameter('getData') === 'true') { so.getFloorPlans(); return; } fetch('https://www.beans.ai/mapswidget/client/trilogy-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]); } if (config.address === '1 Oakbrook Ct, Bloomington, IL') { if (x[j].url.startsWith('/floorplans/oakbrook')) { unit = 'O' + unit; } else { unit = 'B' + unit; } } if (config.address === '9220 Worthington Rd, Westerville, OH') { if (unit.indexOf('K') !== -1) { unit = unit.substring(unit.indexOf('K') + 1) + '-' + unit.substring(0, unit.indexOf('K')); } } var avail = ''; if (x[j].units[k]['link']) { var l = x[j].units[k]['link']; var y = /.*MoveInDate=([0-9/]+).*/.exec(l); if (y) { avail = y[1]; } } 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.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, []); } } }