var beansUrlParameter = function(sParam) { var sPageURL = window.location.search.substring(1), sURLVariables = sPageURL.split('&'), sParameterName, i; for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); if (sParameterName[0] === sParam) { return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]); } } } var getBaseConfig = function(urlFromRequest) { return { address: '', useGroundElevation: false, elevation: 0, canonicalUrl: urlFromRequest }; } var convertUnitsArr2 = function(address, unitsArr, hideMarkers) { var convertedArr = []; for (var i = 0; i < unitsArr.length; i++) { var bedText = (unitsArr[i].bed && unitsArr[i].bed !== '0') ? (unitsArr[i].bed + ' Bed') : 'Studio'; var td = new Date().toISOString().substring(0, 10); var as = (unitsArr[i].availability ? ('on ' + unitsArr[i].availability) : 'Now'); if (unitsArr[i].availability && unitsArr[i].availability <= td) { as = 'Now'; } var onPreviewData; if (unitsArr.floorplanImg) { onPreviewData = [ { value: bedText + ' / ' + unitsArr[i].bath + ' Bath / ' + (unitsArr[i].sqft ? unitsArr[i].sqft.toLocaleString() : '0') + ' sq. ft.' }, { value: 'img:' + unitsArr[i].floorplanImg }, { value: '$' + (unitsArr[i].rent ? unitsArr[i].rent.toLocaleString() : '0') + '/ mo' }, { value: 'Available ' + as } ]; } else { onPreviewData = [ { value: bedText + ' / ' + unitsArr[i].bath + ' Bath / ' + (unitsArr[i].sqft ? unitsArr[i].sqft.toLocaleString() : '0') + ' sq. ft.' }, { value: '$' + (unitsArr[i].rent ? unitsArr[i].rent.toLocaleString() : '0') + '/ mo' }, { value: 'Available ' + as } ]; } convertedArr.push({ address: address, unit: unitsArr[i].unit, options: { markers: { display: hideMarkers ? false : true }, poi: [ { name: "ALL", display: false }, { name: "CLUBHOUSE", display: true }, { name: "SWIMMINGPOOL", display: true }, { name: "OFFICE", display: true }, { name: "GYM", display: true }, { name: "MAILROOM", display: true }, { name: "LAUNDRY", display: true }, { name: "PLAYGROUND", display: true } ], onPreviewData: onPreviewData, onClickData: { name: unitsArr[i].unit ? unitsArr[i].unit.replaceAll('||', ' - ') : '', bed: unitsArr[i].bed, bath: unitsArr[i].bath, sqft: unitsArr[i].sqft, rent: unitsArr[i].rent, floorplanImg: unitsArr[i].floorplanImg, availability: unitsArr[i].availability, link: unitsArr[i].link ? unitsArr[i].link.replaceAll('&', '&') : '' } } }); } return convertedArr; } var convertUnitsArr = function(config, unitsArr, hideMarkers, skipSort) { var addressAndUnitWithOptions; if (unitsArr.length === 0) { unitsArr.push({ unit: '' }); addressAndUnitWithOptions = convertUnitsArr2(config.address, unitsArr, hideMarkers); addressAndUnitWithOptions[0].isPlaceHolder = true; } else { if (!skipSort) { unitsArr.sort((a, b) => { var aa = a.unit ? a.unit : ''; var bb = b.unit ? b.unit : ''; return aa.localeCompare(bb); }); } addressAndUnitWithOptions = convertUnitsArr2(config.address, unitsArr, hideMarkers); } if (config.unitShapeConfig) { for (var i = 0; i < addressAndUnitWithOptions.length; i++) { addressAndUnitWithOptions[i].options.unitShape = config.unitShapeConfig(addressAndUnitWithOptions[i]); } } if (config.poi) { for (var i = 0; i < addressAndUnitWithOptions.length; i++) { for (var j = 0; j < config.poi.length; j++) { addressAndUnitWithOptions[i].options.poi.push(config.poi[j]); } } } return addressAndUnitWithOptions; } var commonImmersives = [ { url: "https://gis-server.beans.ai/arcgis/rest/services/Hosted/Immersive_Layers/FeatureServer/0", elevationInfo: { mode: "absolute-height", offset: 0.1, }, opacity: 0.5, immersiveType: 'trees', renderer: { type: "unique-value", field: "type", uniqueValueInfos: [ { value: "Apricot", symbol: { type: "point-3d", symbolLayers: [ { type: "object", "height": 6, "anchor": "origin", "resource": { "href": "https://static.arcgis.com/arcgis/styleItems/RealisticTrees/gltf/resource/PrunusArmeniaca.glb" } } ] } }, { value: "Mountain Mahogany", symbol: { type: "point-3d", symbolLayers: [ { type: "object", "height": 2, "anchor": "origin", "resource": { "href": "https://static.arcgis.com/arcgis/styleItems/RealisticTrees/gltf/resource/CercocarpusMontanus.glb" } } ] } }, { value: "Rose", symbol: { type: "point-3d", symbolLayers: [ { type: "object", "height": 2, "anchor": "origin", "resource": { "href": "https://static.arcgis.com/arcgis/styleItems/RealisticTrees/gltf/resource/RosaGrandiflora.glb" } } ] } } ] }, isFeature: true }, { url: "https://gis-server.beans.ai/arcgis/rest/services/Hosted/Immersive_Layers/FeatureServer/1", elevationInfo: { mode: "absolute-height", offset: 0.2, }, renderer: { type: "unique-value", field: "type", uniqueValueInfos: [ { value: "Walkway", symbol: { type: "line-3d", symbolLayers: [ { type: "path", profile: "quad", material: { color: "#fcf5de" }, width: 2, // the width in m height: 0.3, // the height in m profileRotation: "heading" } ] // type: "simple-line", // width: 16, // color: "#aaaaaa" } }, { value: "Road", symbol: { type: "line-3d", symbolLayers: [ { type: "path", profile: "quad", material: { color: "#aaaaaa" }, width: 6, // the width in m height: 0.4, // the height in m profileRotation: "heading" } ] } } ] }, isFeature: true }, { url: "https://gis-server.beans.ai/arcgis/rest/services/Hosted/Immersive_Layers/FeatureServer/2", elevationInfo: { mode: "absolute-height", offset: 0.1, }, renderer: { type: "unique-value", field: "type", uniqueValueInfos: [ { value: "Lawn", symbol: { type: "simple-fill", outline: { width: 0 }, color: "rgba(178, 195, 136, 0.35)" } }, { value: "Concrete", symbol: { type: "simple-fill", outline: { width: 0 }, color: "#CCCCCC" } }, { value: "Mulch", symbol: { type: "simple-fill", outline: { width: 0 }, color: "#DBCEA2" } } ] }, isFeature: true }, { url: "https://gis-server.beans.ai/arcgis/rest/services/Hosted/Immersive_Layers/FeatureServer/2", elevationInfo: { mode: "absolute-height", offset: 0.2, }, renderer: { type: "unique-value", field: "type", uniqueValueInfos: [ { value: "Water", symbol: { type: "simple-fill", outline: { width: 0 }, color: "#a5c2d1" } } ] }, isFeature: true }, ]; var getDisplayOptions = function( config, unitShape_, // Default shape selectedUnitShape_, // Selected shape selectableUnitShape_, // Selectable shape hoverUnitShape_ ) { return { propertyAddress: config.address, offsetGroundElevation: config.elevation, useGroundElevation: config.useGroundElevation, filters: config.filters, showUnitList: true, showUnitShape: true, showDirections: false, showPath: false, camera: config.camera, mobileCamera: config.mobileCamera, renameAmenities: config.renameAmenities ? config.renameAmenities : null, shadowModeUnitShape: config.shadowModeUnitShape ? config.shadowModeUnitShape : { fillColor: '#ffffff', fillOpacity: 1.0, }, neighborModeUnitShape: config.neighborModeUnitShape ? config.neighborModeUnitShape : { fillColor: '#D8D7D4', fillOpacity: 1.0, }, unitShape: config.unitShape ? config.unitShape : { fillColor: '#DDE3E0', fillOpacity: 1.0, strokeWeight: 1.0, strokeOpacity: 0.5, strokeColor: '#000000', ...unitShape_ }, selectedUnitShape: config.selectedUnitShape ? config.selectedUnitShape : { fillColor: '#A6671D', fillOpacity: 1.0, strokeWeight: 1.0, strokeOpacity: 1.0, strokeColor: '#ffffff', ...selectedUnitShape_ }, selectableUnitShape: config.selectableUnitShape ? config.selectableUnitShape : { fillColor: '#24453E', fillOpacity: 1.0, strokeWeight: 1.0, strokeOpacity: 1.0, strokeColor: '#ffffff', ...selectableUnitShape_ }, satelliteModeUnitShape: config.satelliteModeUnitShape ? config.satelliteModeUnitShape : { fillColor: '#ffffff', fillOpacity: 1.0, }, neighborShape: config.neighborShape, immersiveModeUnitShape: config.immersiveModeUnitShape, poiShape: config.poiShape, hoverUnitShape: hoverUnitShape_ ? hoverUnitShape_ : null, // mobileUnitShape: { // fillColor: '#ffffff', // fillOpacity: 0.2, // strokeWeight: 0.5, // strokeOpacity: 0.2, // strokeColor: '#000000', // } }; } var BeansLund = function() { }; BeansLund.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.parkwoodterraceapartments.com"] = { address: "1010 N 92nd Plaza, Omaha, NE", }; config["www.deerfieldapartmentsandchateaus.com"] = { camera: {tilt: 40.33564720980427, heading: 30.488886255876128, position: {x: -96.47178438450614, y: 41.42089065264929, z: 140.9344074195251}}, address: "1021 S Howard St, Fremont, NE", }; config["www.vue178.com"] = { camera: {tilt: 46.847046144829676, heading: 54.982767295818704, position: {x: -96.19427704568017, y: 41.24652353774338, z: 238.02599499933422}}, address: "1101 S 178th St, Omaha, NE", }; config["www.sterlingprairietrailnorth.com"] = { camera: {tilt: 57.274699494616854, heading: 1.6635962381362357, position: {x: -93.61511670117991, y: 41.71650373366303, z: 301.69491573702544}}, address: "1108 SW 11th St, Ankeny, IA", }; config["www.oakpointegrandisland.com"] = { camera: {tilt: 62.448534751841166, heading: 37.39642856659205, position: {x: -98.39247210186059, y: 40.926923349092384, z: 182.3152347933501}}, address: "1116 Starwood Ave, Grand Island, NE", }; config["www.park125.com"] = { camera: {tilt: 64.58207572463665, heading: 346.44203884776414, position: {x: -96.10725050936522, y: 41.26130150568172, z: 190.31005098484457}}, address: "12500 W Dodge Rd, Omaha, NE", }; config["www.livebohoflats.com"] = { camera: {tilt: 57.223691868619774, heading: 243.01909684822337, position: {x: -95.931853917522, y: 41.24499004116653, z: 120.241843608208}}, address: "1440 S 13th St, Omaha, NE", }; config["www.thegroverogers.com"] = { camera: {tilt: 57.61719542812018, heading: 207.67593739151965, position: {x: -94.1398819139168, y: 36.290152469405264, z: 272.9524016017094}}, address: "1735 W Chandler Ave, Rogers, AR", unitShape: { fillColor: '#FFFFFF', fillOpacity: 1.0, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, mobileCamera: {tilt: 0.4999470575041315, heading: 270.4688803563015, position: {x: -94.14286272402393, y: 36.28626610861959, z: 681.5170732438564}}, showImmersive: true, showImmersiveLight: true, showImmersiveOnLoad: true, immersiveConfig: [ ...commonImmersives ], overrideHeight: 6, filters: { bed: { name: 'Bedrooms', values: [ {type: 'all', name: 'Any'}, {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: '1200', name: 'Less than $1,200'}, {type: 'min', value1: '1200', name: '$1,200+'} ] }, 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+'} ] } }, }; config["www.firesidewaukee.com"] = { camera: {tilt: 52.03371970519172, heading: 307.3701915142333, position: {x: -93.88062671454372, y: 41.61569636013351, z: 226.04049314185977}}, address: "200 NW 2nd St, Waukee, IA", showImmersive: true, showImmersiveLight: true, showImmersiveOnLoad: true, immersiveConfig: [ { url: "https://gis-server.beans.ai/arcgis/rest/services/Hosted/200_NW_2nd_St_Waukee_IA_surroundings_polygons/SceneServer", elevationInfo: { mode: "absolute-height", offset: 0.5, } }, ], backgroundImage: { src: '/mapswidget/prettymaps/200nw2nd.png', width: '3416px', height: '2556px', position: { lat: 41.6193924, lng: -93.8804580, lat2: 41.6163544, lng2: -93.8858891, } }, }; config["www.livethebenton.com"] = { camera: {tilt: 26.755991825608692, heading: 0.3970219628238006, position: {x: -94.11966113913198, y: 36.439363762936345, z: 318.58878097496927}}, address: "200 Ryan Rd, Pea Ridge, AR", mobileCamera: {tilt: 0.4999762787793616, heading: 269.54646825943456, position: {x: -94.11987176270686, y: 36.44087983460864, z: 315.40195519756526}}, }; config["www.thebrinkapartments.com"] = { camera: {tilt: 58.21672674007546, heading: 327.8746855937261, position: {x: -95.90519337561274, y: 41.00638490751981, z: 160.83289240300655}}, address: "2211 1st Ave, Plattsmouth, NE", }; config["www.sterlingprairietrail.com"] = { camera: {tilt: 64.86225967669229, heading: 102.3969609065059, position: {x: -93.63602376629814, y: 41.70518220838816, z: 206.070002483204}}, address: "2333 SW Plaza Pkwy, Ankeny, IA", }; config["www.tamarinridge.com"] = { camera: {tilt: 52.01877882325649, heading: 283.82066212910104, position: {x: -96.68326636069997, y: 40.73556551673183, z: 208.0444007255137}}, address: "2450 Tamarin Ridge Rd, Lincoln, NE", }; config["www.colercrossing.com"] = { camera: {tilt: 55.80145014368404, heading: 136.33953462342865, position: {x: -94.22239387604773, y: 36.37615506896271, z: 132.55409401934594}}, address: "250 N Walton Blvd, Bentonville, AR", unitShape: { fillColor: '#FFFFFF', fillOpacity: 0.5, strokeWeight: 0.5, strokeOpacity: 0.2, strokeColor: '#000000', }, showImmersive: true, showImmersiveLight: true, showImmersiveOnLoad: true, immersiveConfig: [ ...commonImmersives ], numbersConfig: { size: 16, xOffset: -10, yOffset: -7 }, unitsToExclude: ['CAR', 'GARAGE', 'BICYCLE', 'COMMERCIAL'], backgroundImage: { src: '/mapswidget/prettymaps/250nwalton.png', width: '833px', height: '1393px', position: { lat: 36.37589628809382, lng: -94.22150345428384, lat2: 36.37396351855473, lng2: -94.22022673432087 } }, initialPosition: { lat: 36.37479975451754, lng: -94.22090405808095 }, }; config["www.crosscreekaptslexington.com"] = { camera: {tilt: 62.0735533681327, heading: 194.8312442891697, position: {x: -99.74303459055938, y: 40.76622622934361, z: 168.14117293339223}}, address: "300 Cutler Dr, Lexington, NE", }; config["www.theboulevardjoplin.com"] = { camera: {tilt: 62.25053970078505, heading: 181.41582708308698, position: {x: -94.47106813530783, y: 37.05635215486764, z: 228.57116726227105}}, address: "3311 S Hammons Blvd, Joplin, MO", }; config["www.orpheumtowerapts.com"] = { camera: {tilt: 64.01922999734178, heading: 49.19743985257879, position: {x: -95.93881019812845, y: 41.2549160696301, z: 122.77661272883415}}, address: "405 S 16th St, Omaha, NE", }; config["www.nexusgrayslanding.com"] = { camera: {tilt: 52.43803613958042, heading: 111.31378798440264, position: {x: -93.62990402476558, y: 41.57932912629588, z: 130.7164911404252}}, address: "415 SW 11th St, Des Moines, IA", showImmersive: true, showImmersiveLight: true, showImmersiveOnLoad: true, immersiveConfig: [ ...commonImmersives ], }; config["www.squareat48.com"] = { camera: {tilt: 59.42956581901289, heading: 90.35122891716506, position: {x: -96.65543179271444, y: 40.82875886490218, z: 104.11620012298226}}, address: "4800 Holdrege St, Lincoln, NE", }; config["www.prairieparkapts.com"] = { camera: {tilt: 54.62692759516197, heading: 180.49916484421527, position: {x: -97.0074377431533, y: 42.233668824880034, z: 187.19694148749113}}, address: "801 E 4th St, Wayne, NE", }; config["www.sunrisegardenslincoln.com"] = { camera: {tilt: 59.40855938225191, heading: 3.9430699510789546, position: {x: -96.63525073218884, y: 40.820271885488566, z: 88.95074408780783}}, address: "825 N Cotner Blvd, Lincoln, NE", }; config["www.somersetaptslincoln.com"] = { camera: {tilt: 57.54166453577809, heading: 210.6740323929922, position: {x: -96.60491399822595, y: 40.78939524435201, z: 265.29626661352813}}, address: "8341 Karl Ridge Rd, Lincoln, NE", }; if (config[canonicalUrl]) { return {...baseConfig, ...config[canonicalUrl]}; } return baseConfig; } BeansLund.prototype.getFloorPlans = function(callback) { var so = this; var canonicalUrl = so.getConfigFromUrl().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 = /.*