Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

fix: didn't hide infospot when change panorama #243

Merged
merged 2 commits into from
Feb 17, 2021

Conversation

xuanvan229
Copy link
Contributor

Hi. I got some bugs. When changing PanoramaImage. Some infospot didn't hide the text. I have fixed it. Please take a look.

@claytonrothschild
Copy link

Nice. This was a pain point for me, which I solved with an agressive dispose method on scene change.

this.viewer.panorama && this.viewer.panorama.children && this.viewer.panorama.children.map(c => { c.removeHoverElement && c.removeHoverElement(); c.hide(); c.dispose(); });

Your solution is better.

@flyandi
Copy link
Collaborator

flyandi commented Oct 6, 2020

Can we merge this please since so many have issues with this?

@RamenKebab
Copy link

Hi @claytonrothschild! I used your solution in my panorama changing function, it worked and hid the hoverText in the new panorama. However, it doesn't work for the popups (a div with a texte on white background) that comes when hovering an infoSpot..

function onButtonClick( targetPanorama ) {
bar.classList.remove( 'hide' );
this.viewer.panorama && this.viewer.panorama.children && this.viewer.panorama.children.map(c => { c.removeHoverElement && c.removeHoverElement(); c.hide(); c.dispose(); });
viewer.setPanorama( targetPanorama );
}
...........
infospotHS.addHoverElement( document.getElementById( 'popup' ), 270 );

I am a beginner, I didn't get @xuanvan229's solution as I am not at all using infospot.js :/

Thank you.

@RamenKebab
Copy link

actually how can i use infospot.js while i'm using panolens.min.js ? For custom infospot, it seems necessary. Thanks

@xuanvan229
Copy link
Contributor Author

Hi @RamenKebab, infopost.js has built to panolens.min.js. So If you want to use it in your project. You should change it in your panolens.min.js file or panolens.js

You can find it here.
https://github.com/pchen66/panolens.js/blob/master/build/panolens.js#L2498

@RamenKebab
Copy link

@xuanvan229 This is divine. Your fix works like a charm. Thanks for guidance.

@RamenKebab
Copy link

@xuanvan229 However, it does not work in the Cardboard Mode. These stubborn hoverTexts still don't dissappear...

@flyandi
Copy link
Collaborator

flyandi commented Feb 17, 2021

I am merging this as this has been a real pain point.

@flyandi flyandi merged commit 0ca971b into pchen66:master Feb 17, 2021
@claytonrothschild
Copy link

Welcome @flyandi glad to have a active maintainer on the project again!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants