I make a virtual guide using A-frame in combination with Angular and use next code to remove all hot spots and navigation arrows from the a-entity
tag.
while (this.hotSpotEntity.hasChildNodes()) {
this.hotSpotEntity.removeChild(this.hotSpotEntity.childNodes[0]);
}
while (this.navigationEntity.hasChildNodes()) {
this.navigationEntity.removeChild(this.navigationEntity.childNodes[0]);
}
This code will remove all elements from the a-entity
tags I've defined as global variables. But there is an issue with this code.
P.S.: Can't use databinding because A-frame doesn't support it 😕.
See this first scene below. The arrows and magnifiers are added by the code I've written and are children of the hotspotEntity
and navigationEntity
.
I've I click on a arrow, the code navigates you to a new scene. But you could see that the arrows and hotspots aren't removed. This are the red striped images. The green circled image is added after navigating.
When you click on the green circled arrow, you're navigating to the next scene. Here you could see that the images from the first sky aren't removed but the images of the second scene are removed.
The bug happens only on mobile browsers (Google Chrome for Android, Samsung Internet) and not on desktop browsers (Firefox, Edge).
Could anyone why this bug occurs only on mobile browsers and how I could solve it?
You could test the tour on this link: http://student.howest.be/hein.pauwelyn-vand1/poppr/aframe/ and full code on this GitHub Gist.