Nort
Nort

Reputation: 125

How to rotate google map markers to road direction

[ Flutter / Dart ] I need to create a map where dozens of cars will move and for each of them I need to rotate the icon in the direction of travel. Any ideas how to do this?

Example

Upvotes: 3

Views: 1869

Answers (1)

Bilal Almefleh
Bilal Almefleh

Reputation: 376

try this

Marker(
    markerId: const MarkerId("MarkerIdHere"),
    rotation: location.heading,
    //anchor: const Offset(0.5, 0.5),
    position: LatLng(
        location.latitude, location.longitude),
  );

Upvotes: 2

Related Questions