Reputation: 1337
I have a map that has a search box. A user types an address, and presses enter. The map then zooms out, pans to wherever the target is, then zooms in again. I understand from documentation that this is default behavior and that it's commonly referred to as "Fly To".
The question is... How do you disable this? I don't need fancy animation, I just want it to quickly draw a new map at the Lat/Long chosen and set the zoom level I specify.
Can this be done?
Upvotes: 1
Views: 2214
Reputation: 126697
I assume you're using Mapbox-GL-Geocoder.
Just use setFlyTo
:
geocoder.setFlyTo(false);
Upvotes: -2