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

resetNorth does not fire rotate events #6460

Closed
cephirothdy2j opened this issue Apr 5, 2018 · 5 comments
Closed

resetNorth does not fire rotate events #6460

cephirothdy2j opened this issue Apr 5, 2018 · 5 comments

Comments

@cephirothdy2j
Copy link

Sorry, not sure if this a bug report or a feature request ... If there is a workaround to tell when the user clicks the "On Reset North" button in the Navigation Control, I'd love to hear it.

Expected Behavior

Given that the "Zoom In" and "Zoom Out" buttons in the navigation control fire the zoomIn() and zoomOut() methods (and thus the zoom* events), I would expect that clicking the "Reset North" button would either fire the rotate* events or a new onResetNorth event when it calls resetNorth().

Actual Behavior

Clicking the "Reset North" button only fires the move* events.

@asheemmamoowala
Copy link
Contributor

Clicking on the Reset North button emits the rotateend event. If this is not working for you, please provide a minimal reproduction of the issue on JSbin or JSfiddle that does not include any third party or application-specific code. Thank you!

@cephirothdy2j
Copy link
Author

Here is your JSBin demonstrating the issue ...

Steps to Reproduce

  1. Visit the JSBin link.
  2. Enter an access token in the JavaScript panel.
  3. Rotate the map either by mouse-downing on the compass button, or mouse-downing on the map while holding the control / alt key, and moving the cursor until the map is askew.
  4. You will see the rotateend event fire in your browser's console as expected.
  5. Click the compass button to return the map to north (fires resetNorth()). You will see that the rotateend event does not fire per the browser's console.

@asheemmamoowala
Copy link
Contributor

@cephirothdy2j thank you for reporting this issue. It has been fixed in #6218 and will be available in the next release.

@cephirothdy2j
Copy link
Author

Thanks, @asheemmamoowala. Running the master branch locally I am able to confirm that the issue is resolved.

FYI though resetNorth in ui/camera.js does not yet mention the new event(s) that will fire. 😄

@asheemmamoowala
Copy link
Contributor

#6471 tracks the documentation issue.

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