From 2f15236621d982e9fe6206dfd0b1b64dd1a792d6 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Mon, 6 Nov 2023 21:27:48 -0800 Subject: [PATCH] add ground name --- src/aframe-streetmix-parsers.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/aframe-streetmix-parsers.js b/src/aframe-streetmix-parsers.js index c0a87419a..d75d0547f 100644 --- a/src/aframe-streetmix-parsers.js +++ b/src/aframe-streetmix-parsers.js @@ -1128,6 +1128,7 @@ function processBuildings (left, right, streetWidth, showGround, length) { return placedObjectEl; } + // possible 'block' type input values: grass, fence, narrow, wide, waterfront, residential, parking-lot buildingsArray.forEach((currentValue, index) => { if (currentValue.length === 0) { return; } // if empty string then skip const side = (index === 0) ? 'left' : 'right'; @@ -1136,6 +1137,7 @@ function processBuildings (left, right, streetWidth, showGround, length) { const positionX = ((buildingLotWidth / 2) + (streetWidth / 2)) * sideMultiplier; if (showGround) { + // TODO: consider rewriting this using simple box instead of this json plane method var groundJSONString = JSON.stringify(streetmixParsersTested.createGroundArray(currentValue, length)); var groundParentEl = document.createElement('a-entity'); @@ -1146,6 +1148,7 @@ function processBuildings (left, right, streetWidth, showGround, length) { groundParentEl.setAttribute('position', positionX + 55 + ' 0.2 0'); } groundParentEl.classList.add('ground-' + side); + groundParentEl.setAttribute('data-layer-name', 'Ground ' + side + ': ' + currentValue); buildingElement.appendChild(groundParentEl); }