From adb17ca41fed6f7f59efe22b438e78e905825953 Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Wed, 12 Jun 2024 10:49:04 -0400 Subject: [PATCH 1/2] emit play event for tiles loader in Editor mode --- src/components/street-geo.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/street-geo.js b/src/components/street-geo.js index 9abc93d83..3a89d635a 100644 --- a/src/components/street-geo.js +++ b/src/components/street-geo.js @@ -112,6 +112,13 @@ AFRAME.registerComponent('street-geo', { copyrightEl: '#map-copyright' }); google3dElement.classList.add('autocreated'); + + if (AFRAME.INSPECTOR && AFRAME.INSPECTOR.opened) { + // emit play event to start loading tiles in Editor mode + google3dElement.addEventListener('loaded', () => { + google3dElement.play(); + }); + } google3dElement.setAttribute('data-ignore-raycaster', ''); el.appendChild(google3dElement); self['google3d'] = google3dElement; From d2268f301b1b42fd5f8e11c43d66d4135e6a1091 Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Wed, 12 Jun 2024 18:59:16 -0400 Subject: [PATCH 2/2] add once=true to loaded event --- src/components/street-geo.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/street-geo.js b/src/components/street-geo.js index 3a89d635a..151343b84 100644 --- a/src/components/street-geo.js +++ b/src/components/street-geo.js @@ -115,9 +115,13 @@ AFRAME.registerComponent('street-geo', { if (AFRAME.INSPECTOR && AFRAME.INSPECTOR.opened) { // emit play event to start loading tiles in Editor mode - google3dElement.addEventListener('loaded', () => { - google3dElement.play(); - }); + google3dElement.addEventListener( + 'loaded', + () => { + google3dElement.play(); + }, + { once: true } + ); } google3dElement.setAttribute('data-ignore-raycaster', ''); el.appendChild(google3dElement);