-
Notifications
You must be signed in to change notification settings - Fork 85
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
deactivation of cover fails if moveToKey is called during navigablechanged event #284
Comments
there are workarounds: it's possible to use |
Thanks for reporting. Will investigate. |
Thank you. I figured out where the "race condition" comes from. It's mostly in my code, but runs into the same issue mentioned above. Interestingly the bug occurs even if the new image to be loaded is the same as already in progress. I guess it doesn't happen often enough to warrant a check. Anyway, it happens if the cover button is clicked twice, for which I have a simple version below. The actual use case is different: the user can click on a map to select images, but for that I need to deactivate the cover, which I do by faking a click on the cover button. This works fine. To ease discoverability, users can also simply click on the viewer/cover button and get a default. This re-uses the same code, which fakes the cover button click – thus effectively clicking the button twice. <script>
var mly = new Mapillary.Viewer(
'mly',
'QjI1NnU0aG5FZFZISE56U3R5aWN4ZzplNDVjNDc0YmYwYjJmYjQ0',
'B8AaHVfaEuAQrRYuzSnySg'
);
let coverBtn = document.getElementsByClassName('CoverButton')[0];
function deactivateCoverViaCode() {
coverBtn.click();
coverBtn.click();
}
</script>
<button onclick="deactivateCoverViaCode()">click me instead of cover button</button> |
Fixes #284 Do not execute cover logic if state does not change even if configuration is updated.
Basic information
MapillaryJS version:
2.12.1
System/Browser: latest Firefox and Chromium, but pretty sure it's not browser specific
Steps to Reproduce Behavior
Failed to deactivate cover. Error: Request aborted by a subsequent request to key u0P76tytQBWjrc0alKvR2g.
Full stacktrace on non-minified version
The text was updated successfully, but these errors were encountered: