Skip to content
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

Closed
breunigs opened this issue Sep 9, 2018 · 3 comments
Assignees
Labels
Milestone

Comments

@breunigs
Copy link

breunigs commented Sep 9, 2018

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

<!DOCTYPE html>
<html>
<head>
    <script src='https://unpkg.com/mapillary-js@2.12.1/dist/mapillary.min.js'></script>
    <link href='https://unpkg.com/mapillary-js@2.12.1/dist/mapillary.min.css' rel='stylesheet' />
</head>

<body>
    <div id='mly' style='width: 640px; height: 480px;'></div>
    <script>
        var mly = new Mapillary.Viewer(
            'mly',
            'QjI1NnU0aG5FZFZISE56U3R5aWN4ZzplNDVjNDc0YmYwYjJmYjQ0',
            'B8AaHVfaEuAQrRYuzSnySg'
        );

        mly.on(Mapillary.Viewer.navigablechanged, () => {
            mly.moveToKey('u0P76tytQBWjrc0alKvR2g');
        });
    </script>
</body>
</html>
  1. click cover arrow button
  2. observe Failed to deactivate cover. Error: Request aborted by a subsequent request to key u0P76tytQBWjrc0alKvR2g.

Full stacktrace on non-minified version

ComponentController.ts:174 Failed to deactivate cover. Error: Request aborted by a subsequent request to key u0P76tytQBWjrc0alKvR2g.
    at AbortMapillaryError.MapillaryError [as constructor] (MapillaryError.ts:3)
    at new AbortMapillaryError (AbortMapillaryError.ts:11)
    at Navigator._abortRequest (Navigator.ts:296)
    at Navigator.moveToKey$ (Navigator.ts:125)
    at Viewer.moveToKey (Viewer.ts:633)
    at Viewer.mly.on (mapillary-break-cover-move.html:18)
    at Viewer.EventEmitter.fire (EventEmitter.ts:51)
    at SafeSubscriber._next (Observer.ts:56)
    at SafeSubscriber.__tryOrUnsub (Subscriber.js:238)
    at SafeSubscriber.next (Subscriber.js:185)


  | (anonymous) | @ | ComponentController.ts:174
-- | -- | -- | --
  | SafeSubscriber.__tryOrUnsub | @ | Subscriber.js:238
  | SafeSubscriber.error | @ | Subscriber.js:197
  | Subscriber._error | @ | Subscriber.js:128
  | Subscriber.error | @ | Subscriber.js:102
  | OuterSubscriber.notifyError | @ | OuterSubscriber.js:22
  | InnerSubscriber._error | @ | InnerSubscriber.js:26
  | Subscriber.error | @ | Subscriber.js:102
  | Subject.error | @ | Subject.js:70
  | Navigator._abortRequest | @ | Navigator.ts:296
  | Navigator.moveToKey$ | @ | Navigator.ts:125
  | Viewer.moveToKey | @ | Viewer.ts:633
  | mly.on | @ | mapillary-break-cover-move.html:18
  | EventEmitter.fire | @ | EventEmitter.ts:51
  | (anonymous) | @ | Observer.ts:56
  | SafeSubscriber.__tryOrUnsub | @ | Subscriber.js:238
  | SafeSubscriber.next | @ | Subscriber.js:185
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | Subject.next | @ | Subject.js:55
  | ComponentController._setNavigable | @ | ComponentController.ts:143
  | (anonymous) | @ | ComponentController.ts:171
  | SafeSubscriber.__tryOrSetError | @ | Subscriber.js:247
  | SafeSubscriber.next | @ | Subscriber.js:187
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | SwitchMapSubscriber.notifyNext | @ | switchMap.js:126
  | InnerSubscriber._next | @ | InnerSubscriber.js:23
  | Subscriber.next | @ | Subscriber.js:89
  | FirstSubscriber._emitFinal | @ | first.js:135
  | FirstSubscriber._emit | @ | first.js:118
  | FirstSubscriber._next | @ | first.js:97
  | Subscriber.next | @ | Subscriber.js:89
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | ReplaySubject._subscribe | @ | ReplaySubject.js:55
  | Observable._trySubscribe | @ | Observable.js:172
  | Subject._trySubscribe | @ | Subject.js:97
  | Observable.subscribe | @ | Observable.js:160
  | ConnectableObservable._subscribe | @ | ConnectableObservable.js:25
  | Observable.subscribe | @ | Observable.js:160
  | RefCountOperator.call | @ | refCount.js:22
  | Observable.subscribe | @ | Observable.js:157
  | FirstOperator.call | @ | first.js:70
  | Observable.subscribe | @ | Observable.js:157
  | subscribeToResult | @ | subscribeToResult.js:23
  | SwitchMapSubscriber._innerSub | @ | switchMap.js:103
  | SwitchMapSubscriber._next | @ | switchMap.js:96
  | Subscriber.next | @ | Subscriber.js:89
  | FirstSubscriber._emitFinal | @ | first.js:135
  | FirstSubscriber._emit | @ | first.js:118
  | FirstSubscriber._next | @ | first.js:97
  | Subscriber.next | @ | Subscriber.js:89
  | BehaviorSubject._subscribe | @ | BehaviorSubject.js:28
  | Observable._trySubscribe | @ | Observable.js:172
  | Subject._trySubscribe | @ | Subject.js:97
  | Observable.subscribe | @ | Observable.js:160
  | FirstOperator.call | @ | first.js:70
  | Observable.subscribe | @ | Observable.js:157
  | SwitchMapOperator.call | @ | switchMap.js:69
  | Observable.subscribe | @ | Observable.js:157
  | (anonymous) | @ | ComponentController.ts:164
  | SafeSubscriber.__tryOrUnsub | @ | Subscriber.js:238
  | SafeSubscriber.next | @ | Subscriber.js:185
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | Subject.next | @ | Subject.js:55
  | ReplaySubject.next | @ | ReplaySubject.js:31
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | ScanSubscriber._tryNext | @ | scan.js:117
  | ScanSubscriber._next | @ | scan.js:104
  | Subscriber.next | @ | Subscriber.js:89
  | MergeMapSubscriber.notifyNext | @ | mergeMap.js:145
  | InnerSubscriber._next | @ | InnerSubscriber.js:23
  | Subscriber.next | @ | Subscriber.js:89
  | Subject.next | @ | Subject.js:55
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | MapSubscriber._next | @ | map.js:85
  | Subscriber.next | @ | Subscriber.js:89
  | DistinctUntilChangedSubscriber._next | @ | distinctUntilChanged.js:103
  | Subscriber.next | @ | Subscriber.js:89
  | SwitchMapSubscriber.notifyNext | @ | switchMap.js:126
  | InnerSubscriber._next | @ | InnerSubscriber.js:23
  | Subscriber.next | @ | Subscriber.js:89
  | CombineLatestSubscriber.notifyNext | @ | combineLatest.js:133
  | InnerSubscriber._next | @ | InnerSubscriber.js:23
  | Subscriber.next | @ | Subscriber.js:89
  | MapSubscriber._next | @ | map.js:85
  | Subscriber.next | @ | Subscriber.js:89
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | ReplaySubject._subscribe | @ | ReplaySubject.js:55
  | Observable._trySubscribe | @ | Observable.js:172
  | Subject._trySubscribe | @ | Subject.js:97
  | Observable.subscribe | @ | Observable.js:160
  | ConnectableObservable._subscribe | @ | ConnectableObservable.js:25
  | Observable.subscribe | @ | Observable.js:160
  | RefCountOperator.call | @ | refCount.js:22
  | Observable.subscribe | @ | Observable.js:157
  | MapOperator.call | @ | map.js:56
  | Observable.subscribe | @ | Observable.js:157
  | subscribeToResult | @ | subscribeToResult.js:23
  | CombineLatestSubscriber._complete | @ | combineLatest.js:112
  | Subscriber.complete | @ | Subscriber.js:114
  | ArrayObservable._subscribe | @ | ArrayObservable.js:116
  | Observable._trySubscribe | @ | Observable.js:172
  | Observable.subscribe | @ | Observable.js:160
  | CombineLatestOperator.call | @ | combineLatest.js:78
  | Observable.subscribe | @ | Observable.js:157
  | subscribeToResult | @ | subscribeToResult.js:23
  | SwitchMapSubscriber._innerSub | @ | switchMap.js:103
  | SwitchMapSubscriber._next | @ | switchMap.js:96
  | Subscriber.next | @ | Subscriber.js:89
  | SwitchMapSubscriber.notifyNext | @ | switchMap.js:126
  | InnerSubscriber._next | @ | InnerSubscriber.js:23
  | Subscriber.next | @ | Subscriber.js:89
  | CombineLatestSubscriber.notifyNext | @ | combineLatest.js:133
  | InnerSubscriber._next | @ | InnerSubscriber.js:23
  | Subscriber.next | @ | Subscriber.js:89
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | Subject.next | @ | Subject.js:55
  | ReplaySubject.next | @ | ReplaySubject.js:31
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | MapSubscriber._next | @ | map.js:85
  | Subscriber.next | @ | Subscriber.js:89
  | Subject.next | @ | Subject.js:55
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | Subject.next | @ | Subject.js:55
  | ReplaySubject.next | @ | ReplaySubject.js:31
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | DistinctUntilChangedSubscriber._next | @ | distinctUntilChanged.js:103
  | Subscriber.next | @ | Subscriber.js:89
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | Subject.next | @ | Subject.js:55
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | MapSubscriber._next | @ | map.js:85
  | Subscriber.next | @ | Subscriber.js:89
  | DoSubscriber._next | @ | tap.js:88
  | Subscriber.next | @ | Subscriber.js:89
  | FilterSubscriber._next | @ | filter.js:89
  | Subscriber.next | @ | Subscriber.js:89
  | WithLatestFromSubscriber._tryProject | @ | withLatestFrom.js:128
  | WithLatestFromSubscriber._next | @ | withLatestFrom.js:112
  | Subscriber.next | @ | Subscriber.js:89
  | Subject.next | @ | Subject.js:55
  | StateService.start | @ | StateService.ts:487
  | (anonymous) | @ | ComponentController.ts:166
  | SafeSubscriber.__tryOrUnsub | @ | Subscriber.js:238
  | SafeSubscriber.next | @ | Subscriber.js:185
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | SwitchMapSubscriber.notifyNext | @ | switchMap.js:126
  | InnerSubscriber._next | @ | InnerSubscriber.js:23
  | Subscriber.next | @ | Subscriber.js:89
  | Subject.next | @ | Subject.js:55
  | ReplaySubject.next | @ | ReplaySubject.js:31
  | (anonymous) | @ | Navigator.ts:313
  | SafeSubscriber.__tryOrUnsub | @ | Subscriber.js:238
  | SafeSubscriber.next | @ | Subscriber.js:185
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | DoSubscriber._next | @ | tap.js:88
  | Subscriber.next | @ | Subscriber.js:89
  | FirstSubscriber._emitFinal | @ | first.js:135
  | FirstSubscriber._emit | @ | first.js:118
  | FirstSubscriber._tryPredicate | @ | first.js:110
  | FirstSubscriber._next | @ | first.js:94
  | Subscriber.next | @ | Subscriber.js:89
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | Subject.next | @ | Subject.js:55
  | ReplaySubject.next | @ | ReplaySubject.js:31
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | MergeMapSubscriber.notifyNext | @ | mergeMap.js:145
  | InnerSubscriber._next | @ | InnerSubscriber.js:23
  | Subscriber.next | @ | Subscriber.js:89
  | MapSubscriber._next | @ | map.js:85
  | Subscriber.next | @ | Subscriber.js:89
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | Subject.next | @ | Subject.js:55
  | ReplaySubject.next | @ | ReplaySubject.js:31
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | Subscriber._next | @ | Subscriber.js:125
  | load (async) |   |  
  | xmlHTTP.onload | @ | NodeCache.ts:378
  | load (async) |   |  
  | (anonymous) | @ | NodeCache.ts:365
  | Observable._trySubscribe | @ | Observable.js:172
  | Observable.subscribe | @ | Observable.js:160
  | subscribeToResult | @ | subscribeToResult.js:23
  | CombineLatestSubscriber._complete | @ | combineLatest.js:112
  | Subscriber.complete | @ | Subscriber.js:114
  | ArrayObservable._subscribe | @ | ArrayObservable.js:116
  | Observable._trySubscribe | @ | Observable.js:172
  | Observable.subscribe | @ | Observable.js:160
  | CombineLatestOperator.call | @ | combineLatest.js:78
  | Observable.subscribe | @ | Observable.js:157
  | FinallyOperator.call | @ | finalize.js:26
  | Observable.subscribe | @ | Observable.js:157
  | ConnectableObservable.connect | @ | ConnectableObservable.js:40
  | RefCountOperator.call | @ | refCount.js:24
  | Observable.subscribe | @ | Observable.js:157
  | FirstOperator.call | @ | first.js:70
  | Observable.subscribe | @ | Observable.js:157
  | NodeCache.cacheAssets$ | @ | NodeCache.ts:227
  | Node.cacheAssets$ | @ | Node.ts:503
  | (anonymous) | @ | GraphService.ts:138
  | MergeMapSubscriber._tryNext | @ | mergeMap.js:122
  | MergeMapSubscriber._next | @ | mergeMap.js:112
  | Subscriber.next | @ | Subscriber.js:89
  | MapSubscriber._next | @ | map.js:85
  | Subscriber.next | @ | Subscriber.js:89
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | Subject.next | @ | Subject.js:55
  | ReplaySubject.next | @ | ReplaySubject.js:31
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | Subject.next | @ | Subject.js:55
  | (anonymous) | @ | GraphService.ts:182
  | SafeSubscriber.__tryOrUnsub | @ | Subscriber.js:238
  | SafeSubscriber.next | @ | Subscriber.js:185
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | DoSubscriber._next | @ | tap.js:88
  | Subscriber.next | @ | Subscriber.js:89
  | MergeMapSubscriber.notifyNext | @ | mergeMap.js:145
  | InnerSubscriber._next | @ | InnerSubscriber.js:23
  | Subscriber.next | @ | Subscriber.js:89
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | Subject.next | @ | Subject.js:55
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | MapSubscriber._next | @ | map.js:85
  | Subscriber.next | @ | Subscriber.js:89
  | DoSubscriber._next | @ | tap.js:88
  | Subscriber.next | @ | Subscriber.js:89
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | MapSubscriber._next | @ | map.js:85
  | Subscriber.next | @ | Subscriber.js:89
  | OuterSubscriber.notifyNext | @ | OuterSubscriber.js:19
  | InnerSubscriber._next | @ | InnerSubscriber.js:23
  | Subscriber.next | @ | Subscriber.js:89
  | (anonymous) | @ | PromiseObservable.js:66
  | Promise.then (async) |   |  
  | r.then | @ | falcor.browser.min.js:2
  | PromiseObservable._subscribe | @ | PromiseObservable.js:62
  | Observable._trySubscribe | @ | Observable.js:172
  | Observable.subscribe | @ | Observable.js:160
  | subscribeToResult | @ | subscribeToResult.js:23
  | DeferSubscriber._callFactory | @ | DeferObservable.js:94
  | DeferSubscriber.tryDefer | @ | DeferObservable.js:85
  | DeferSubscriber | @ | DeferObservable.js:81
  | DeferObservable._subscribe | @ | DeferObservable.js:71
  | Observable._trySubscribe | @ | Observable.js:172
  | Observable.subscribe | @ | Observable.js:160
  | MapOperator.call | @ | map.js:56
  | Observable.subscribe | @ | Observable.js:157
  | CatchOperator.call | @ | catchError.js:79
  | Observable.subscribe | @ | Observable.js:157
  | DoOperator.call | @ | tap.js:63
  | Observable.subscribe | @ | Observable.js:157
  | MapOperator.call | @ | map.js:56
  | Observable.subscribe | @ | Observable.js:157
  | FinallyOperator.call | @ | finalize.js:26
  | Observable.subscribe | @ | Observable.js:157
  | ConnectableObservable.connect | @ | ConnectableObservable.js:40
  | RefCountOperator.call | @ | refCount.js:24
  | Observable.subscribe | @ | Observable.js:157
  | subscribeToResult | @ | subscribeToResult.js:23
  | MergeMapSubscriber._innerSub | @ | mergeMap.js:132
  | MergeMapSubscriber._tryNext | @ | mergeMap.js:129
  | MergeMapSubscriber._next | @ | mergeMap.js:112
  | Subscriber.next | @ | Subscriber.js:89
  | FirstSubscriber._emitFinal | @ | first.js:135
  | FirstSubscriber._emit | @ | first.js:118
  | FirstSubscriber._next | @ | first.js:97
  | Subscriber.next | @ | Subscriber.js:89
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | ReplaySubject._subscribe | @ | ReplaySubject.js:55
  | Observable._trySubscribe | @ | Observable.js:172
  | Subject._trySubscribe | @ | Subject.js:97
  | Observable.subscribe | @ | Observable.js:160
  | ConnectableObservable._subscribe | @ | ConnectableObservable.js:25
  | Observable.subscribe | @ | Observable.js:160
  | RefCountOperator.call | @ | refCount.js:22
  | Observable.subscribe | @ | Observable.js:157
  | FirstOperator.call | @ | first.js:70
  | Observable.subscribe | @ | Observable.js:157
  | MergeMapOperator.call | @ | mergeMap.js:87
  | Observable.subscribe | @ | Observable.js:157
  | DoOperator.call | @ | tap.js:63
  | Observable.subscribe | @ | Observable.js:157
  | FinallyOperator.call | @ | finalize.js:26
  | Observable.subscribe | @ | Observable.js:157
  | GraphService.cacheNode$ | @ | GraphService.ts:180
  | Navigator._moveToKey$ | @ | Navigator.ts:330
  | Navigator.moveToKey$ | @ | Navigator.ts:129
  | (anonymous) | @ | ComponentController.ts:160
  | SwitchMapSubscriber._next | @ | switchMap.js:90
  | Subscriber.next | @ | Subscriber.js:89
  | FirstSubscriber._emitFinal | @ | first.js:135
  | FirstSubscriber._emit | @ | first.js:118
  | FirstSubscriber._next | @ | first.js:97
  | Subscriber.next | @ | Subscriber.js:89
  | BehaviorSubject._subscribe | @ | BehaviorSubject.js:28
  | Observable._trySubscribe | @ | Observable.js:172
  | Subject._trySubscribe | @ | Subject.js:97
  | Observable.subscribe | @ | Observable.js:160
  | FirstOperator.call | @ | first.js:70
  | Observable.subscribe | @ | Observable.js:157
  | SwitchMapOperator.call | @ | switchMap.js:69
  | Observable.subscribe | @ | Observable.js:157
  | (anonymous) | @ | ComponentController.ts:164
  | SafeSubscriber.__tryOrUnsub | @ | Subscriber.js:238
  | SafeSubscriber.next | @ | Subscriber.js:185
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | Subject.next | @ | Subject.js:55
  | ReplaySubject.next | @ | ReplaySubject.js:31
  | Subscriber._next | @ | Subscriber.js:125
  | Subscriber.next | @ | Subscriber.js:89
  | ScanSubscriber._tryNext | @ | scan.js:117
  | ScanSubscriber._next | @ | scan.js:104
  | Subscriber.next | @ | Subscriber.js:89
  | MergeMapSubscriber.notifyNext | @ | mergeMap.js:145
  | InnerSubscriber._next | @ | InnerSubscriber.js:23
  | Subscriber.next | @ | Subscriber.js:89
  | Subject.next | @ | Subject.js:55
  | Component.configure | @ | Component.ts:94
  | onclick | @ | CoverComponent.ts:115
@breunigs
Copy link
Author

breunigs commented Sep 9, 2018

there are workarounds: it's possible to use setTimeout(moveToKeyFun, 0) as a workaround. I'm suspecting there's still a race condition here somewhere on slow connections, but I'm not sure about that – I can't reproduce it in my code, nor a minimal example. I just see the viewer exhibit the same "black image" symptom, but so far I never had a debugger attached. Either way, using viewer.on(Viewer.nodechanged, () => { canMoveNow = true }) to determine isNavigable as a workaround sidesteps all of these issues.

@oscarlorentzon oscarlorentzon self-assigned this Sep 9, 2018
@oscarlorentzon
Copy link
Member

Thanks for reporting. Will investigate.

@breunigs
Copy link
Author

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>

breunigs added a commit to breunigs/veloroute that referenced this issue Sep 10, 2018
@oscarlorentzon oscarlorentzon added this to the 2.13.1 milestone Oct 4, 2018
oscarlorentzon added a commit that referenced this issue Oct 4, 2018
Fixes #284

Do not execute cover logic if state does not change even
if configuration is updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants