Skip to content

Commit

Permalink
fix gltf plugin demo (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
alxart authored Nov 7, 2023
1 parent f111012 commit 8bee7ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/gltf-plugin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@

<body>
<div id="container"></div>
<script src="https://mapgl.2gis.com/api/js/v1"></script>
<script src="https://mapgl.2gis.com/api/js/v1.40.0"></script>
<script src="https://unpkg.com/@2gis/mapgl-gltf@^1/dist/bundle.js"></script>
<script src="https://unpkg.com/mapgl-snow"></script>
<script src="./index.js"></script>
</body>

</html>
</html>
10 changes: 5 additions & 5 deletions src/gltf-plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ function sleep(time) {
setTimeout(resolve, time);
});
}

function waitIdle() {
return new Promise((resolve) => {
map.once('idle', resolve);
});
}

async function runScenario(scenario) {
for (const part of scenario) {
// console.log(part);
Expand Down Expand Up @@ -71,11 +71,11 @@ async function runScenario(scenario) {
}
map.setRotation(part.rotation, { ...params, normalize: false });
}

if (typeof part.f === 'function') {
part.f();
}

if (part.waitIdle) {
await waitIdle();
} else {
Expand Down Expand Up @@ -1780,4 +1780,4 @@ const realtyScene = [
],
},
];
plugin.addRealtyScene(realtyScene);
plugin.addRealtyScene(realtyScene);

0 comments on commit 8bee7ee

Please sign in to comment.