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: "4", 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: 4, 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: "5", 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: 5, 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" } } ] } }, { value: "6", symbol: { type: "point-3d", symbolLayers: [ { type: "object", "height": 2, "anchor": "origin", "resource": { "href": "https://static.arcgis.com/arcgis/styleItems/RealisticTrees/gltf/resource/RosaGrandiflora.glb" } } ] } }, { value: 6, 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: "2", 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: 2, 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" } ] } }, { value: "1", 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" } ] } }, { value: 1, 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: "1", symbol: { type: "simple-fill", outline: { width: 0 }, color: "rgba(178, 195, 136, 0.35)" } }, { value: 1, 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" } }, { value: "8", symbol: { type: "simple-fill", outline: { width: 0 }, color: "#DBCEA2" } }, { value: 8, 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", "8ae1deef5ff14e8:6365333662366565333139343432376138633830", 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", "8ae1deef5ff14e8:6365333662366565333139343432376138633830", 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 BeansAtlantic = function() { }; BeansAtlantic.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.mayfairreserve.com"] = { isAtlanticData: true, rentcafeLink: "https://mayfairreserve.securecafe.com/onlineleasing/mayfairreserve/oleapplication.aspx?stepname=RentalOptions", prettyLayer: 'https://gis.beans.ai/arcgis/sharing/rest/content/items/041770491a2e42389f54c3962a0e795f/resources/styles/root.json?f=pjson', camera: {tilt: 56.918113640610684, heading: 270.4156697633532, position: {x: -88.04802627795945, y: 43.05876738257342, z: 132.68172234203666}}, address: "11011 W North Ave, Milwaukee, WI", unitShape: { fillColor: '#D8D7D4', fillOpacity: 0.2, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#356B63', }, selectedUnitShape: { fillColor: '#4c4c4d', strokeColor: '#356B63', }, selectableUnitShape: { fillColor: '#7f948e', strokeColor: '#356B63', }, poiShape: { fillOpacity: 1.0, colorCodes: [ { value: 2, color: "rgba(210, 155, 66, 1.0)" }, // GYM, PETWASH, CYCLESTORAGE { value: 3, color: "rgba(96, 164, 170, 0.4)" }, { value: 4, color: "rgba(195, 168, 207, 0.4)" }, { value: 5, color: "rgba(165, 222, 122, 1.0)" }, // SPORTS FIELDS { value: 6, color: "rgba(152, 227, 223, 1.0)" }, { value: 7, color: "rgba(238, 112, 71, 0.4)" }, { value: 8, color: "rgba(227, 223, 152, 1.0)" }, // AMENITY, GAME, LOUNGE { value: 9, color: "rgba(0, 124, 207, 0.1)" }, // GARAGE { value: 10, color: "rgba(200, 16, 46, 0.4)" }, { value: 11, color: "rgba(236, 112, 188, 0.4)" }, { value: 12, color: "rgba(206, 165, 6, 1.0)" }, { value: 13, color: "rgba(144, 87, 157, 1.0)" }, { value: 14, color: "rgba(61, 180, 245, 1.0)" }, { value: 15, color: "rgba(169, 122, 43, 1.0)" }, { value: 16, color: "rgba(125, 222, 82, 1.0)" }, ] }, }; config["www.stjohnslanding.com"] = { isGraphqlData: true, locationUrl: "g5-cl-1lsplr2cdi-atlantic-residential-green-cove-springs-fl", camera: {tilt: 56.59473177316998, heading: 321.85981357557773, position: {x: -81.6902952693808, y: 30.005420074998035, z: 458.94820559956133}}, address: "1408 N Orange Ave, Green Cove Springs, FL", poiShape: { fillOpacity: 1.0, }, selectedUnitShape: { fillColor: '#212529', }, selectableUnitShape: { fillColor: '#1376a3', }, }; config["www.loriaansley.com"] = { isAtlanticData: true, rentcafeLink: "https://loriaansley.securecafe.com/onlineleasing/loriaansley/oleapplication.aspx?stepname=RentalOptions", 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+'} ] }, bath: { name: 'Bathrooms', values: [ {type: 'all', name: 'Any'}, {type: 'min', value1: '1', name: '1BA+'}, {type: 'min', value1: '2', name: '2BA+'}, {type: 'min', value1: '3', name: '3BA+'} ] }, 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: 'range', value1: '1000', value2: '1500', name: '1000-1500'}, {type: 'min', value1: '1500', name: '1500+'} ] } }, prettyLayer: 'https://beans.maps.arcgis.com/sharing/rest/content/items/6465974adfdb437c8423881400b8517d/resources/styles/root.json?f=pjson', showImmersive: true, immersiveConfig: [ ...commonImmersives ], showImmersiveLight: true, showImmersiveOnLoad: true, camera: {tilt: 67.2057197941128, heading: 15.958990670001608, position: {x: -84.38729305867012, y: 33.7919905011912, z: 129.8844938809052}}, mobileCamera: {tilt: 67.20571979413803, heading: 15.958833482940852, position: {x: -84.3875756775082, y: 33.79212163436891, z: 129.8844938809052}}, address: "1441 Peachtree NE St, Atlanta, GA", unitShape: { fillColor: '#DDE3E0', fillOpacity: 0.15, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000' }, selectedUnitShape: { fillColor: '#CDA192', }, selectableUnitShape: { fillColor: '#53666E', strokeColor: '#AC9B45', }, iconSizeMultiplier: 1.0, immersiveConfig: [ ...commonImmersives, { url: "https://tiles.arcgis.com/tiles/ob6JNU9Q3wDJysjr/arcgis/rest/services/1441_fp1/SceneServer", opacity: 0.15, elevationInfo: { mode: "absolute-height", offset: 0.5, } }, { url: "https://tiles.arcgis.com/tiles/ob6JNU9Q3wDJysjr/arcgis/rest/services/1441_Units_1/SceneServer", elevationInfo: { mode: "absolute-height", offset: 0.5, }, immersiveType: 'units' } ], numbersConfig: { size: 50, rotate: -25, convert: (a) => { if (!a) { return a; } if (a.indexOf('-') !== -1) { a = a.substring(a.indexOf('-') + 1); } return a; } }, unitsToExclude: [], }; config["www.indigowpb.com"] = { isAtlanticData: true, rentcafeLink: "https://indigowpb.securecafe.com/onlineleasing/indigowpb/oleapplication.aspx?stepname=RentalOptions", camera: {tilt: 48.39908208062107, heading: 24.557841729019156, position: {x: -80.07510122232512, y: 26.69298590953101, z: 186.68731984123588}}, address: "1500 Centrepark Blvd, West Palm Beach, FL", }; config["www.flatsatwestshore.com"] = { isYardiData: true, yardiDomain: "", address: "1500 Westshore Dr, Cumming, GA", }; config["www.rowemke.com"] = { isAtlanticData: true, rentcafeLink: "https://rowemke.securecafe.com/onlineleasing/rowemke/oleapplication.aspx?stepname=RentalOptions", prettyLayer: 'https://gis.beans.ai/arcgis/sharing/rest/content/items/041770491a2e42389f54c3962a0e795f/resources/styles/root.json?f=pjson', camera: {tilt: 58.48493826171419, heading: 349.08013441252814, position: {x: -87.9011364423647, y: 43.05358203249509, z: 130.47351641580462}}, address: "1845 N Water St, Milwaukee, WI", unitShape: { fillColor: '#D8D7D4', fillOpacity: 0.2, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#356B63', }, selectedUnitShape: { fillColor: '#4c4c4d', strokeColor: '#356B63', }, selectableUnitShape: { fillColor: '#7f948e', strokeColor: '#356B63', }, poiShape: { fillOpacity: 1.0, colorCodes: [ { value: 2, color: "rgba(210, 155, 66, 1.0)" }, // GYM, PETWASH, CYCLESTORAGE { value: 3, color: "rgba(96, 164, 170, 0.4)" }, { value: 4, color: "rgba(195, 168, 207, 0.4)" }, { value: 5, color: "rgba(165, 222, 122, 1.0)" }, // SPORTS FIELDS { value: 6, color: "rgba(152, 227, 223, 1.0)" }, { value: 7, color: "rgba(238, 112, 71, 0.4)" }, { value: 8, color: "rgba(227, 223, 152, 1.0)" }, // AMENITY, GAME, LOUNGE { value: 9, color: "rgba(0, 124, 207, 0.1)" }, // GARAGE { value: 10, color: "rgba(200, 16, 46, 0.4)" }, { value: 11, color: "rgba(236, 112, 188, 0.4)" }, { value: 12, color: "rgba(206, 165, 6, 1.0)" }, { value: 13, color: "rgba(144, 87, 157, 1.0)" }, { value: 14, color: "rgba(61, 180, 245, 1.0)" }, { value: 15, color: "rgba(169, 122, 43, 1.0)" }, { value: 16, color: "rgba(125, 222, 82, 1.0)" }, ] }, numbersConfig: { rotate: -46, }, }; config["www.bexleychamblee.com"] = { isAtlanticData: true, rentcafeLink: "https://bexleychamblee.securecafe.com/onlineleasing/bexleychamblee/oleapplication.aspx?stepname=RentalOptions", camera: {tilt: 46.49187795859919, heading: 351.73665659564506, position: {x: -84.30149707226954, y: 33.89115652957408, z: 224.41695711482316}}, address: "2175 American Dr, Chamblee, GA", poiShape: { fillOpacity: 1.0, }, unitShape: { fillColor: '#D8D7D4', fillOpacity: 0.5, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, selectedUnitShape: { fillColor: '#A6671D', }, selectableUnitShape: { fillColor: '#24453E', }, }; config["www.revelballpark.com"] = { isGraphqlData: true, locationUrl: "g5-cl-1lspmvse5q-atlantic-residential-atlanta-ga", camera: {tilt: 44.123461027058674, heading: 210.9489067858534, position: {x: -84.468873466206, y: 33.89569209560381, z: 235.12847942113876}}, address: "2855 Crescent Pkwy, Atlanta, GA", poiShape: { fillOpacity: 1.0, }, unitShape: { fillColor: '#D0CABD', fillOpacity: 0.2, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, selectedUnitShape: { fillColor: '#223645', }, selectableUnitShape: { fillColor: '#C3B22E', }, }; config["www.reserveballpark.com"] = { isGraphqlData: true, locationUrl: "g5-cl-1lspmsknho-atlantic-residential-atlanta-ga", camera: {tilt: 36.49718696634273, heading: 5.420756606242943, position: {x: -84.46895787742838, y: 33.892128361449174, z: 339.79831133503467}}, address: "2875 Crescent Pkwy, Atlanta, GA", poiShape: { fillOpacity: 1.0, }, unitShape: { fillColor: '#D8D7D4', fillOpacity: 0.5, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, selectedUnitShape: { fillColor: '#0a303e', }, selectableUnitShape: { fillColor: '#DE3517', strokeColor: '#AC9B45', }, }; config["www.lumenbriarcliff.com"] = { isGraphqlData: true, locationUrl: "g5-cl-1ndz2odlsm-atlantic-residential-atlanta-ga", camera: {tilt: 59.823468330629794, heading: 39.85925786716388, position: {x: -84.31461334246497, y: 33.83668821866528, z: 137.31736273039132}}, address: "3070 Briarcliff NE Rd, Atlanta, GA", poiShape: { fillOpacity: 1.0, }, unitShape: { fillColor: '#D8D7D4', fillOpacity: 0.5, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, selectedUnitShape: { fillColor: '#2B302E', }, selectableUnitShape: { fillColor: '#9daa9a', strokeColor: '#AC9B45', }, }; config["www.thanksgivingpark.com"] = { isAtlanticData: true, rentcafeLink: "https://loriaansley.securecafe.com/onlineleasing/loriaansley/oleapplication.aspx?stepname=RentalOptions", prettyLayer: 'https://beans.maps.arcgis.com/sharing/rest/content/items/6465974adfdb437c8423881400b8517d/resources/styles/root.json?f=pjson', showImmersive: true, immersiveConfig: [ ...commonImmersives, { url: "https://tiles.arcgis.com/tiles/ob6JNU9Q3wDJysjr/arcgis/rest/services/3400_Ashton_Blvd_Lehi_UT_units/SceneServer", elevationInfo: { mode: "absolute-height", offset: 0.5, }, immersiveType: 'units' } ], showImmersiveLight: true, showImmersiveOnLoad: true, camera: {tilt: 66.95108915051031, heading: 344.6524223238847, position: {x: -111.89341601801671, y: 40.42806888780203, z: 88.48551955167204}}, address: "3400 Ashton Blvd, Lehi, UT", unitShape: { fillColor: '#FFFFFF', fillOpacity: 0.35, strokeWeight: 0.5, strokeOpacity: 0.5, strokeColor: '#000000', }, selectedUnitShape: { fillColor: '#A6671D', }, selectableUnitShape: { fillColor: '#24453E', }, poiShape: { colorCodes: [ { value: 2, color: "rgba(205, 162, 145, 1.0)" }, { value: 3, color: "rgba(205, 162, 145, 1.0)" }, { value: 4, color: "rgba(205, 162, 145, 1.0)" }, { value: 5, color: "rgba(165, 222, 122, 1.0)" }, { value: 6, color: "rgba(152, 227, 223, 1.0)" }, { value: 7, color: "rgba(205, 162, 145, 1.0)" }, { value: 8, color: "rgba(205, 162, 145, 1.0)" }, { value: 9, color: "rgba(205, 162, 145, 1.0)" }, { value: 10, color: "rgba(205, 162, 145, 1.0)" }, { value: 11, color: "rgba(205, 162, 145, 1.0)" }, { value: 12, color: "rgba(205, 162, 145, 1.0)" }, { value: 13, color: "rgba(205, 162, 145, 1.0)" }, { value: 14, color: "rgba(205, 162, 145, 1.0)" }, { value: 15, color: "rgba(205, 162, 145, 1.0)" }, { value: 16, color: "rgba(205, 162, 145, 1.0)" }, ] }, numbersConfig: { size: 75, convert: (a) => { if (!a) { return a; } if (a.indexOf('-') !== -1) { a = a.substring(a.indexOf('-') + 1); } return a; } }, unitsToExclude: [], }; config["www.luccafoxvalley.com"] = { isAtlanticData: true, rentcafeLink: "https://luccafoxvalley.securecafe.com/onlineleasing/luccafoxvalley/oleapplication.aspx?stepname=RentalOptions", prettyLayer: 'https://gis.beans.ai/arcgis/sharing/rest/content/items/041770491a2e42389f54c3962a0e795f/resources/styles/root.json?f=pjson', camera: {tilt: 50.55016508235591, heading: 355.30930218752565, position: {x: -88.2116762919486, y: 41.75832423874858, z: 219.95342853106558}}, address: "3955 Fox Valley Center Dr, Aurora, IL", selectedUnitShape: { fillColor: '#F27D4D', strokeColor: '#356B63', }, selectableUnitShape: { fillColor: '#2a5b6c', strokeColor: '#356B63', }, poiShape: { fillOpacity: 1.0, colorCodes: [ { value: 2, color: "rgba(251, 216, 114, 1.0)" }, // GYM, PETWASH, CYCLESTORAGE { value: 3, color: "rgba(251, 216, 114, 1.0)" }, { value: 4, color: "rgba(251, 216, 114, 1.0)" }, { value: 5, color: "rgba(251, 216, 114, 1.0)" }, // SPORTS FIELDS { value: 6, color: "rgba(152, 227, 223, 1.0)" }, { value: 7, color: "rgba(251, 216, 114, 1.0)" }, { value: 8, color: "rgba(251, 216, 114, 1.0)" }, // AMENITY, GAME, LOUNGE { value: 9, color: "rgba(251, 216, 114, 1.0)" }, // GARAGE { value: 10, color: "rgba(251, 216, 114, 1.0)" }, { value: 11, color: "rgba(251, 216, 114, 1.0)" }, { value: 12, color: "rgba(251, 216, 114, 1.0)" }, { value: 13, color: "rgba(251, 216, 114, 1.0)" }, { value: 14, color: "rgba(251, 216, 114, 1.0)" }, { value: 15, color: "rgba(251, 216, 114, 1.0)" }, { value: 16, color: "rgba(251, 216, 114, 1.0)" }, ] }, unitShapeConfig: (addressAndUnitWithOptionsObj) => { if (addressAndUnitWithOptionsObj.options && addressAndUnitWithOptionsObj.options.onClickData) { var bed = addressAndUnitWithOptionsObj.options.onClickData.bed ? addressAndUnitWithOptionsObj.options.onClickData.bed : 0; if (bed === 0 || bed === '0') { return { fillColor: '#2a5b6c', fillOpacity: 1.0, strokeWeight: 1.0, strokeOpacity: 1.0, strokeColor: '#ffffff' }; } else if (bed === 1 || bed === '1') { return { fillColor: '#00263e', fillOpacity: 1.0, strokeWeight: 1.0, strokeOpacity: 1.0, strokeColor: '#ffffff' }; } else if (bed === 2 || bed === '2') { return { fillColor: '#aca39a', fillOpacity: 1.0, strokeWeight: 1.0, strokeOpacity: 1.0, strokeColor: '#ffffff' }; } } return null; }, }; config["www.evertonflats.com"] = { isGraphqlData: true, locationUrl: "g5-cl-1lspmqhmve-atlantic-residential-warrenville-il", camera: {tilt: 59.56935601229724, heading: 62.8234575441237, position: {x: -88.20724862383075, y: 41.81423363329417, z: 228.56187619641423}}, address: "3S635 Everton Dr, Warrenville, IL", poiShape: { fillOpacity: 1.0, }, unitShape: { fillColor: '#D8D7D4', fillOpacity: 0.5, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, selectedUnitShape: { fillColor: '#A16B38', }, selectableUnitShape: { fillColor: '#CEA276', strokeColor: '#AC9B45', }, }; config["www.brookfieldreserveapts.com"] = { isGraphqlData: true, locationUrl: "g5-cl-1lspltv2x4-atlantic-residential-brookfield-wi", camera: {tilt: 57.09215309116136, heading: 125.27451481367018, position: {x: -88.08530843501639, y: 43.036104371426475, z: 135.40762175247073}}, address: "405 Bishops Way, Brookfield, WI", poiShape: { fillOpacity: 1.0, }, unitShape: { fillColor: '#D8D7D4', fillOpacity: 0.5, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, selectedUnitShape: { fillColor: '#7f392c', }, selectableUnitShape: { fillColor: '#535659', strokeColor: '#AC9B45', }, }; config["www.lumendoraville.com"] = { isGraphqlData: true, locationUrl: "g5-cl-1mgfd18hgz-atlantic-residential-atlanta-ga", camera: {tilt: 46.824016393574325, heading: 26.581594291026068, position: {x: -84.28232789024561, y: 33.91791631571872, z: 248.81965160369873}}, address: "4256 Tilly Mill Rd, Atlanta, GA", poiShape: { fillOpacity: 1.0, }, unitShape: { fillColor: '#D8D7D4', fillOpacity: 0.5, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, selectedUnitShape: { fillColor: '#646662', }, selectableUnitShape: { fillColor: '#AC9B45', strokeColor: '#AC9B45', }, }; config["www.lumenfoxvalley.com"] = { isAtlanticData: true, rentcafeLink: "https://lumenfoxvalley.securecafe.com/onlineleasing/lumenfoxvalley/oleapplication.aspx?stepname=RentalOptions", prettyLayer: 'https://gis.beans.ai/arcgis/sharing/rest/content/items/041770491a2e42389f54c3962a0e795f/resources/styles/root.json?f=pjson', camera: {tilt: 60.806042111589235, heading: 328.6901376194994, position: {x: -88.20627366168112, y: 41.755062221851325, z: 213.70459317136556}}, address: "4450 Fox Valley Center Dr, Aurora, IL", unitShape: { fillColor: '#D8D7D4', fillOpacity: 0.2, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#356B63', }, selectedUnitShape: { fillColor: '#F27D4D', strokeColor: '#356B63', }, selectableUnitShape: { fillColor: '#8ACFC5', strokeColor: '#356B63', }, poiShape: { fillOpacity: 1.0, colorCodes: [ { value: 2, color: "rgba(210, 155, 66, 1.0)" }, // GYM, PETWASH, CYCLESTORAGE { value: 3, color: "rgba(96, 164, 170, 0.4)" }, { value: 4, color: "rgba(195, 168, 207, 0.4)" }, { value: 5, color: "rgba(165, 222, 122, 1.0)" }, // SPORTS FIELDS { value: 6, color: "rgba(152, 227, 223, 1.0)" }, { value: 7, color: "rgba(238, 112, 71, 0.4)" }, { value: 8, color: "rgba(227, 223, 152, 1.0)" }, // AMENITY, GAME, LOUNGE { value: 9, color: "rgba(0, 124, 207, 0.1)" }, // GARAGE { value: 10, color: "rgba(200, 16, 46, 0.4)" }, { value: 11, color: "rgba(236, 112, 188, 0.4)" }, { value: 12, color: "rgba(206, 165, 6, 1.0)" }, { value: 13, color: "rgba(144, 87, 157, 1.0)" }, { value: 14, color: "rgba(61, 180, 245, 1.0)" }, { value: 15, color: "rgba(169, 122, 43, 1.0)" }, { value: 16, color: "rgba(125, 222, 82, 1.0)" }, ] }, }; config["www.reserveatwauwatosa.com"] = { isGraphqlData: true, locationUrl: "g5-cl-1lspoiuldb-atlantic-residential-milwaukee-wi", camera: {tilt: 52.832234496516584, heading: 336.65294730599163, position: {x: -87.98745279391963, y: 43.042437279474846, z: 224.35755000635982}}, address: "6100 W State St, Wauwatosa, WI", poiShape: { fillOpacity: 1.0, }, unitShape: { fillColor: '#D0CABD', fillOpacity: 0.2, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, selectedUnitShape: { fillColor: '#025682', }, selectableUnitShape: { fillColor: '#b1c107', }, }; config["www.sciochicago.com"] = { isGraphqlData: true, locationUrl: "g5-cl-1lspjnkkv8-atlantic-residential-chicago-il", camera: {tilt: 49.629288663005084, heading: 64.79001893320178, position: {x: -87.6686208499424, y: 41.869429827562946, z: 242.32843304984272}}, address: "901 S Ashland Ave, Chicago, IL", poiShape: { fillOpacity: 1.0, }, unitShape: { fillColor: '#a9cbc1', fillOpacity: 0.2, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, selectedUnitShape: { fillColor: '#1d262a', }, selectableUnitShape: { fillColor: '#f15a2b', }, }; if (config[canonicalUrl]) { return {...baseConfig, ...config[canonicalUrl]}; } return baseConfig; } BeansAtlantic.prototype.getFloorPlans = function(callback) { var so = this; if (beansUrlParameter('getData') === 'true') { } } BeansAtlantic.prototype.checkAndGetData = function() { var so = this; if (beansUrlParameter('getData') === 'true') { so.getFloorPlans(); } } BeansAtlantic.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, []); } }