Skip to content

Commit

Permalink
Merge pull request #351 from 3DStreet/mapbox-map-issue
Browse files Browse the repository at this point in the history
fix mapbox not visible map issue
  • Loading branch information
kfarr authored Sep 19, 2023
2 parents bf7b4b3 + f0d6be8 commit c2705b5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/json-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,14 @@ function createEntityFromObj(entityData, parentEl) {
entity.setAttribute('geometry', 'primitive', entityData['primitive']);
}

// load this attributes in advance in right order to correctly apply other specific components
for (const attr of ['geometry', 'material']) {
if (entityData.components[attr]) {
entity.setAttribute(attr, entityData.components[attr]);
delete entityData.components[attr];
}
}

if (entityData.id) {
entity.setAttribute('id', entityData.id);
}
Expand Down

0 comments on commit c2705b5

Please sign in to comment.