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

MglMap.movingMethod has no apparent effect #205

Closed
mloffer opened this issue Jan 13, 2020 · 2 comments
Closed

MglMap.movingMethod has no apparent effect #205

mloffer opened this issue Jan 13, 2020 · 2 comments

Comments

@mloffer
Copy link
Contributor

mloffer commented Jan 13, 2020

Setting movingMethod to jumpTo does not disable animations.

<mgl-map
    [style]="'mapbox://styles/mapbox/streets-v9'"
    [zoom]="[9]"
    [center]="[-74.50, 40]"
    (load)="map = $event"
    movingMethod="jumpTo"
></mgl-map>
@mloffer
Copy link
Contributor Author

mloffer commented Feb 7, 2020

Ah, this is really a shortcoming of the Mapbox GL JS API.

Animations for fitBounds must be defined via fitBoundOptions. There's an undocumented duration property that you can use to disable animations.

<mgl-map
    [fitBounds]="[-124.763068, 45.543541, -116.915989, 49.002494]"
    [fitBoundsOptions]="{ duration: 0 }"
></mgl-map>

@mloffer mloffer closed this as completed Feb 7, 2020
@dmytro-gokun
Copy link
Collaborator

@mloffer Thanks for sharing your findings!

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