Skip to content

moveend event handler is invoked after result is triggered #131

Closed

Description

@Erutan409

My moveend handler is being triggered before the map even starts to move to the location I select from the search results.

mapboxgl: v0.41.0
geocoder: v2.1.1

Activity

  1. changed the title [-]`moveend` handler is invoked after `result` is triggered[/-] [+]`moveend` event handler is invoked after `result` is triggered[/+] on Oct 30, 2017
  2. andrewharvey commented on Dec 15, 2017

    @andrewharvey
    Collaborator

    @Erutan409 I suspect this is because of #99, which causes the result event to be fired twice. As part of that the map tries to animate to the location twice (the first one being interrupted by the second).

    Interrupting a camera animation with another camera animation in GL JS causes the moveend event to fire, hence you're getting the issue you describe.

    Unfortunately #99 is not easy to fix for both modern browsers and IE11, so it remains a bug.

    If you don't need to support IE11 then you can try #99 (comment) and see if that resolves the issue?

  3. Erutan409 commented on Dec 17, 2017

    @Erutan409
    Author

    I'll check my code Monday, but I think I solved it with a closure and a brief timeout. It was weird, but necessary.

  4. added this to the v4.0.0 milestone on Mar 21, 2019
  5. scottsfarley93 commented on Mar 21, 2019

    @scottsfarley93

    This was addressed in #229 and will be fixed when version 4 is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions