-
-
Notifications
You must be signed in to change notification settings - Fork 695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Virtual-Tour: Rotate before and after a new node, chain nodes #933
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
rotateBeforeLoad
only works withposition
, when usinggps
the user won't know what is the final computed position. It would be better to have anoffsetPosition
which will be added to the link position (hence moving the marker/arrow but not where the viewer is rotated before going to the next node) -
rotateAfterLoad
andnextNodeId
are advanced features that can be easily implemented with event listeners, it is be much more versatile
(the following code changes requests won't be needed once the above modifications are made)
@@ -342,6 +342,7 @@ export class VirtualTourPlugin extends AbstractConfigurablePlugin< | |||
|
|||
const fromNode = this.state.currentNode; | |||
const fromLinkPosition = fromNode && fromLink ? this.__getLinkPosition(fromNode, fromLink) : null; | |||
const rotateBeforeLoad = fromNode && fromLink && fromLink.rotateBeforeLoad ? fromLink.rotateBeforeLoad : fromLinkPosition; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const rotateBeforeLoad = fromNode && fromLink && fromLink.rotateBeforeLoad ? fromLink.rotateBeforeLoad : fromLinkPosition; | |
const rotateBeforeLoad = fromLink?.rotateBeforeLoad ?? fromLinkPosition; |
@@ -432,6 +433,24 @@ export class VirtualTourPlugin extends AbstractConfigurablePlugin< | |||
|
|||
return true; | |||
}) | |||
.then(() => { | |||
const currentNode = this.state.currentNode; | |||
const rotateAfterLoad = fromNode && fromLink && fromLink.rotateAfterLoad ? fromLink.rotateAfterLoad : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const rotateAfterLoad = fromNode && fromLink && fromLink.rotateAfterLoad ? fromLink.rotateAfterLoad : null; | |
const rotateAfterLoad = fromLink?.rotateAfterLoad; |
@@ -432,6 +433,24 @@ export class VirtualTourPlugin extends AbstractConfigurablePlugin< | |||
|
|||
return true; | |||
}) | |||
.then(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is not point of chaining a promise here, the code can be put on line 433
} | ||
}) | ||
.then(() => { | ||
const nextNodeId = fromNode && fromLink ? fromLink.nextNodeId : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const nextNodeId = fromNode && fromLink ? fromLink.nextNodeId : null; | |
const nextNodeId = fromLink?.nextNodeId; |
Do you mean those features shouldn't be implemented, or should they be implemented with a NodeChanged event listener? |
They shouldn't be implemented |
I can't really understand why the build fails, I implemented your requests. |
don't worry that's on me, it is broken on the main branch too |
This feature/bug fix has been released in version 5.1.5. |
For my usecase I added the following features to the Virtual-Tour-Plugin:
I'd be very happy, if these would make it upstream. Please tell me, what you think about the implementation.
Merge request checklist