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

eventData not passed during flyTo #4337

Closed
remster opened this issue Feb 27, 2017 · 3 comments
Closed

eventData not passed during flyTo #4337

remster opened this issue Feb 27, 2017 · 3 comments

Comments

@remster
Copy link
Contributor

remster commented Feb 27, 2017

v0.32.1:

Steps to Trigger Behavior

  1. register event listener for "movestart"
  2. issue a flyTo to the current center passing arbitrary eventData

Expected Behavior

eventData received by the "movestart" handler

Actual Behavior

eventData not received by the "movestart" handler
This is because:
`

    // When u₀ = u₁, the optimal path doesn’t require both ascent and descent.
    if (Math.abs(u1) < 0.000001) {
        // Perform a more or less instantaneous transition if the path is too short.
        if (Math.abs(w0 - w1) < 0.000001) return this.easeTo(options);

`
around this LOC when i type this.

The use case is simple:

  • the user puts the map in the mode where it follows the user's position as the user moves.
  • the user un-puts the map from that mode by dragging the map or looking something up elsewhere.

therefore:
When the map in the 'follow' mode moves in response to the user's position it should remain in the 'follow' mode. if the map moves for any other reason, it should exit the 'follow' mode - writing this as sometimes people give me interesting workarounds.

@mollymerp
Copy link
Contributor

Thanks for the detailed report @remster! Nice 🕵️‍♂️ – we should pass eventData to easeTo there. Would you be interested in submitting a PR for this fix?

remster pushed a commit to remster/mapbox-gl-js that referenced this issue Feb 28, 2017
@remster
Copy link
Contributor Author

remster commented Feb 28, 2017

@mollymerp : i suppose this simple bug was a great way to start.

questions:

  • how i do i (stop-mode) debug these tests and how do i run them selectively?
  • how do i get attention of some reviewers?
  • what's the magic trick for pasting code into these github chats? You see below that my code doesn't look like code at all.
  • I had 2 failing tests at the onset, where is the test status page? i.e.: are they expected?

`

/home/remek/Projects/mapbox-gl-js/test/unit/ui/map.test.js:319
map.on('error', ({ error }) => {
^
SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
at startup (node.js:136:18)
at node.js:966:3
12589 passing (43s)
2 failing

  1. test/unit/style/style.test.js test/unit/style/style.test.js:
    test/unit/style/style.test.js

  2. test/unit/ui/map.test.js test/unit/ui/map.test.js:
    test/unit/ui/map.test.js

`

@mollymerp
Copy link
Contributor

@remster great questions and thanks for your PR!

how i do i (stop-mode) debug these tests and how do i run them selectively?

You can run the tests selectively using something like node test/unit/ui/camera.test.js

how do i get attention of some reviewers?

The gl team monitors open Pull Requests closely, so we will always respond when you open a new one to help you get it merged.

what's the magic trick for pasting code into these github chats? You see below that my code doesn't look like code at all.

✨ you can learn all the markdown magic tricks using this guide

I had 2 failing tests at the onset, where is the test status page? i.e.: are they expected?

The error you posted is due to the version of node you're using to run them. If you use node version > 6 those tests should pass.

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

No branches or pull requests

2 participants