Skip to content

Commit

Permalink
hotfix: change colon to bullet in data-layer-name
Browse files Browse the repository at this point in the history
- to prevent "Segment: type, variant, etc." being parsed as property:value
- closes #423
  • Loading branch information
kfarr committed Dec 1, 2023
1 parent 877f036 commit eb2b5c2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dist/aframe-street-component.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/aframe-streetmix-parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe
// append the new surfaceElement to the segmentParentEl
streetParentEl.append(segmentParentEl);
segmentParentEl.setAttribute('position', segmentPositionX + ' 0 0');
segmentParentEl.setAttribute('data-layer-name', 'Segment: ' + segments[i].type + ', ' + variantList[0]);
segmentParentEl.setAttribute('data-layer-name', 'Segment ' + segments[i].type + ', ' + variantList[0]);
}
// create new brown box to represent ground underneath street
const dirtBox = document.createElement('a-box');
Expand All @@ -1140,7 +1140,7 @@ function processBuildings (left, right, streetWidth, showGround, length) {
const buildingElement = document.createElement('a-entity');
const clonedObjectRadius = 0.45 * length;
buildingElement.classList.add('buildings-parent');
buildingElement.setAttribute('data-layer-name', 'Buildings & Blocks Container');
buildingElement.setAttribute('data-layer-name', 'Buildings & Blocks Container');
buildingElement.setAttribute('position', '0 0.2 0');
const buildingsArray = [left, right];

Expand Down Expand Up @@ -1215,7 +1215,7 @@ function processBuildings (left, right, streetWidth, showGround, length) {
groundParentEl.setAttribute('position', { x: groundPositionX });
}
groundParentEl.classList.add('ground-' + side);
groundParentEl.setAttribute('data-layer-name', 'Ground ' + side + ': ' + currentValue);
groundParentEl.setAttribute('data-layer-name', 'Ground ' + side + ' ' + currentValue);
buildingElement.appendChild(groundParentEl);
}

Expand All @@ -1241,7 +1241,7 @@ function processBuildings (left, right, streetWidth, showGround, length) {
buildingPos.x += sideMultiplier * (-70.5);
}
const newBuildings = createBuilding(currentValue, sideMultiplier);
newBuildings.setAttribute('data-layer-name', 'Buildings ' + side + ': ' + currentValue);
newBuildings.setAttribute('data-layer-name', 'Buildings ' + side + ' ' + currentValue);

newBuildings.setAttribute('position', buildingPos);
buildingElement.append(newBuildings);
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ AFRAME.registerComponent('streetmix-loader', {
console.log('therefore setting metadata sceneTitle as streetmixName', streetmixName);
}

el.setAttribute('data-layer-name', 'Streetmix: ' + streetmixName);
el.setAttribute('data-layer-name', 'Streetmix ' + streetmixName);

if (data.showBuildings) {
el.setAttribute('street', 'right', streetmixResponseObject.data.street.rightBuildingVariant);
Expand Down

0 comments on commit eb2b5c2

Please sign in to comment.