Flutter Google Maps - Rotate marker according to the driving direction

4,552

Solution 1

https://pub.dev/packages/location plugin :

Marker( rotation: currentLocation.heading )

Solution 2

you can add compass plugin https://pub.dev/packages/flutter_compass and simply set the result direction to marker

Share:
4,552
Buddhika
Author by

Buddhika

I’m a Software Engineer, who focuses on the mobile, web and electronics. While I enjoy all aspects of my carrier, Learning and doing things I've never done is the part of my life as a technical enthusiast rather than being an ordinary developer. I’m truly passionate about my work and always eager to develop new phenomenons.

Updated on December 12, 2022

Comments

  • Buddhika
    Buddhika over 1 year

    Can anyone share a documentation / code sample for Flutter google maps plugin where I can rotate the marker ( ex: a car icon ) according to the driving direction. I saw this can be achieved on native library by rotating the marker. But couldn't fjnd any option to rotate the marker in Flutter.

    I guess we need to consider below points while rotating the marker. Please add your thoughts on this as well.

    Map North Direction. Devices rotation from compass.

    Thanks