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
Now comes the interesting part, we'll add the car to the map as a marker and to make it rotate we'll use the mobile device's compass, we'll ask the direction it's pointing to and this will be passed to the marker every time it changes which will make it rotate in the given direction.
Marker({ position: a, map: map, icon: { path: google. maps. SymbolPath. FORWARD_CLOSED_ARROW, scale: 6, fillColor: "red", fillOpacity: 0.8, strokeWeight: 2, rotation: angleDegrees //this is how to rotate the pointer } });
https://pub.dev/packages/location plugin :
Marker( rotation: currentLocation.heading )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With