Skip to content

Commit

Permalink
Merge pull request #320 from 3DStreet/save-load-2d-layers
Browse files Browse the repository at this point in the history
add layers-2d node support to save/load
  • Loading branch information
kfarr committed Aug 3, 2023
2 parents 9e7ef92 + 84f166d commit 14758ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<script src="./dist/aframe-street-component.js"></script>

<!-- mapbox -->
<script src="https://unpkg.com/aframe-mapbox-component/dist/aframe-mapbox-component.min.js"></script>
<script src="./src/lib/aframe-mapbox-component.min.js"></script>

<!-- save / load -->
<script src="./src/json-utils.js"></script>
Expand Down
6 changes: 4 additions & 2 deletions src/json-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ and returns a Javascript object
function convertDOMElToObject (entity) {
const data = [];
const environmentElement = document.querySelector('#environment');
const sceneEntities = [entity, environmentElement];
const layers2DElement = document.querySelector('#layers-2d');
const sceneEntities = [entity, environmentElement, layers2DElement];

for (const entry of sceneEntities) {
const entityData = getElementData(entry);
Expand Down Expand Up @@ -83,7 +84,8 @@ function getAttributes (entity) {
}

function toPropString (propData) {
if (typeof propData === 'string' || typeof propData === 'number' || typeof propData === 'boolean') {
if (typeof propData === 'string' || typeof propData === 'number' || typeof propData === 'boolean' ||
Array.isArray(propData)) {
return (propData).toString();
}
if (propData.isVector3 || propData.isVector2 || propData.isVector4 ||
Expand Down

0 comments on commit 14758ce

Please sign in to comment.