mapbox-maps-flutter icon indicating copy to clipboard operation
mapbox-maps-flutter copied to clipboard

How to center camera on user Location

Open jacesimons14 opened this issue 1 year ago • 3 comments

Hello, How can I center the camera on the user's gps location? I've looked through the example app and the docs and I can't find a single thing about centering the camera on the user's location. I tried using the geolocator dart package but there's conflicts with the types in that package and the types that this mapbox package wants to use. Any help would be appreciated, thnak you!

jacesimons14 avatar Oct 19 '24 04:10 jacesimons14

There seems to be not option currently to center camera on User's Location. I have decided to use geolocator package to to get user current Position and fly to user current position for now

bibekgyawali2 avatar Oct 24 '24 07:10 bibekgyawali2

There is no mode to enable for this, but you can use this tricky method. It works fine in my gps navigation.

https://gist.github.com/hkben/844d46a829f667e91fa6e6078e8b019c

MapleNoise avatar Oct 29 '24 11:10 MapleNoise

Recently we've implemented a feature that should make this possible, use FollowPuckViewportState to make the camera track the user location.

evil159 avatar Jan 27 '25 13:01 evil159