MAPBOX JS
Hi Everyone.
When I render a marker with specific coordinates on the map using MAPBOX, I want the map to automatically redirect to those coordinates, just like in Leaflet JS, which I am more familiar with. If you are aware of the set View function that exists in leaflet JS that's is what I am looking for. In any case, I'm hoping that MAPBOX has a comparable feature that I could use for my project.
8 Replies
I am not familiar with mapbox but a quick search came up with this:
your amazing chris thank you i must of not found it beacuse i searched a lot i guess different names
I agree that it isn't the most intuitive of function names. I would have thought something like
setCenter()
(with optional panning ) would have made more sense.yeah i got it to work
now figuring out how i can have it to zoom in
not just fly to it
Amongst other options, flyTo() accepts a zoom:
https://docs.mapbox.com/mapbox-gl-js/api/map/#map#flyto
your a G
thank you
Actually, bearing in mind all those options, the naming isn't too bad 😆
Mapbox actually looks quite interesting - I might have to have a play with that when I get a moment.
yeah
currently using it beacuase i just learned about promises
so putting the info i know in a project
with apis
fetching and using .thens haha
that's the only way i can truly understand a topic