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; } const commonImmersivesNormalized = [ { u: "https://gis-server.beans.ai/arcgis/rest/services/Hosted/Immersive_Layers/FeatureServer/0", c: { offset: 0.1, opacity: 0.25, immersiveType: 'trees', options: [ { values: ['Apricot', 4, '4'], symbol: { type: "point-3d", symbolLayers: [ { type: "object", "height": 4, "anchor": "origin", "resource": { // https://static.arcgis.com/arcgis/styleItems/RealisticTrees/gltf/resource/PrunusArmeniaca.glb "href": 'https://static.arcgis.com/arcgis/styleItems/ThematicTrees/gltf/resource/SorbusAria.glb' } } ] } }, { values: ['Mountain Mahogany', 5, '5'], symbol: { type: "point-3d", symbolLayers: [ { type: "object", "height": 2, "anchor": "origin", "resource": { // https://static.arcgis.com/arcgis/styleItems/RealisticTrees/gltf/resource/CercocarpusMontanus.glb "href": 'https://static.arcgis.com/arcgis/styleItems/ThematicTrees/gltf/resource/AcerPlatanoides.glb' } } ] } }, { values: ['Rose', 6, '6'], symbol: { type: "point-3d", symbolLayers: [ { type: "object", "height": 2, "anchor": "origin", "resource": { // https://static.arcgis.com/arcgis/styleItems/RealisticTrees/gltf/resource/RosaGrandiflora.glb "href": 'https://static.arcgis.com/arcgis/styleItems/ThematicTrees/gltf/resource/AcerPlatanoides.glb' } } ] } } ] } }, { u: "https://gis-server.beans.ai/arcgis/rest/services/Hosted/Immersive_Layers/FeatureServer/1", c: { offset: 0.2, options: [ { values: ['Walkway', 2, '2'], symbol: { type: "line-3d", symbolLayers: [ { type: "path", profile: "quad", material: { color: "#E3DDCA" }, width: 2, // the width in m height: 0.2, // the height in m profileRotation: "heading" } ] } }, { values: ['Road', 1, '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" } ] } } ] } }, { u: "https://gis-server.beans.ai/arcgis/rest/services/Hosted/Immersive_Layers/FeatureServer/2", c: { offset: 0.1, options: [ { values: ['Lawn', 1, '1'], symbol: { type: "simple-fill", outline: { width: 0 }, color: "rgba(178, 195, 136, 0.35)" } }, { values: ['Tree_Lawn', 2, '2'], symbol: { type: "simple-fill", outline: { width: 0 }, color: "rgba(130, 152, 77, 0.35)" } }, { values: ['Nearmap_Concrete_Slab', 3, '3'], symbol: { type: "simple-fill", outline: { width: 0 }, color: "#CCCCCC" } }, { values: ['Mulch', 8, '8'], symbol: { type: "simple-fill", outline: { width: 0 }, color: "#DBCEA2" } } ] } }, { u: "https://gis-server.beans.ai/arcgis/rest/services/Hosted/Immersive_Layers/FeatureServer/2", c: { offset: 0.2, options: [ { values: ['Water', 10, '10'], symbol: { type: "polygon-3d", symbolLayers: [ { type: "water", waveDirection: 180, color: "#a5c2d1", waveStrength: "moderate", waterbodySize: "medium" } ] }, } ] } } ]; var commonImmersives = []; for (var k = 0; k < commonImmersivesNormalized.length; k++) { var u = commonImmersivesNormalized[k].u; var c = commonImmersivesNormalized[k].c; var t = commonImmersivesNormalized[k].t ? commonImmersivesNormalized[k].t : 'type'; var obj = { url: u, elevationInfo: { mode: "absolute-height", offset: c.offset }, opacity: c.opacity, immersiveType: c.immersiveType, renderer: { type: 'unique-value', field: t, uniqueValueInfos: [] }, isFeature: true }; for (var i = 0; i < c.options.length; i++) { for (var j = 0; j < c.options[i].values.length; j++) { obj.renderer.uniqueValueInfos.push({ value: c.options[i].values[j], symbol: c.options[i].symbol }); } } commonImmersives.push(obj); } 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, poiOptions: config.poiOptions, showUnderground: config.showUnderground, showUnitList: true, showUnitShape: true, outsideButtons: true, showFloorSlider: true, showDirections: false, showPath: config.showPath, path: config.path, 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: '#ffffff', fillOpacity: 1.0, }, unitShape: config.unitShape ? config.unitShape : { fillColor: '#ffffff', fillOpacity: 1.0, strokeWeight: 1.0, strokeOpacity: 0.5, strokeColor: '#000000', ...unitShape_ }, selectedUnitShape: config.selectedUnitShape ? config.selectedUnitShape : { fillColor: '#cc088e', fillOpacity: 1.0, strokeWeight: 1.0, strokeOpacity: 1.0, strokeColor: '#ffffff', ...selectedUnitShape_ }, selectableUnitShape: config.selectableUnitShape ? config.selectableUnitShape : { fillColor: '#0cb1a1', 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: '#ffffff', fillOpacity: 0.2, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, // Default color { fillColor: '#cc088e', fillOpacity: 1.0, strokeWeight: 0.5, strokeOpacity: 0.2, }, // Selected color { fillColor: '#0cb1a1', } // Selectable color ); be1.render( "body-inner-1", config.transientKeySecret, addressAndUnitWithOptions, { hideNavigateButton: true, hideMyLocationButton: true }, { beansMapType: 'ESRI', initialMap: 'STREET', prettyLayer: config.prettyLayer ? config.prettyLayer : '', modernButtons: true, modernBeansCard: displayOptions.hideBeansCard ? false : true, outsideButtons: true, showCompass: true, showFullScreenMode: false, showNeighbors: false, showPOIButton: true, showSeparateFacilitiesCard: true, animateOnLoad: config.animateOnLoad, showPath: config.showPath, path: config.path, 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: config.initialTilt !== undefined ? config.initialTilt : 30, initialZ: config.initialZ !== undefined ? config.initialZ : 400, initialHeading: config.initialHeading !== undefined ? config.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: '#cc088e', }, // Selected color { fillColor: '#0cb1a1', } // Selectable color ); if (displayOptions.unitShape) { displayOptions.unitShape.fillOpacity = 1.0; displayOptions.unitShape.strokeWeight = 0.5; } be1.render( "body-inner-2", config.transientKeySecret, 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 BeansLund = function() { }; BeansLund.prototype.getFloorPlans = function() { var so = this; var canonicalUrl = window.location.hostname; if (beansUrlParameter('canonicalUrl')) { canonicalUrl = beansUrlParameter('canonicalUrl'); } 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://' + canonicalUrl + '/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]; 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]; } } 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 j = 0; j < jo['accommodationFloorPlan'].length; j++) { floorplansData[j].beds = jo['accommodationFloorPlan'][j]['numberOfBedrooms']; floorplansData[j].baths = jo['accommodationFloorPlan'][j]['numberOfFullBathrooms']; } } for (var i = 0; i < floorplansData.length; i++) { var xhr = new XMLHttpRequest(); if (floorplansData[i].url && floorplansData[i].url.indexOf('securecafe') !== -1) { continue; } 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(); } var y = /.*type="button".*?id="(.*?)".*?applyGAClick.(.*?)." href='(.*?)'.*/.exec(j); // var y = /.*