Y W
Y W

Reputation: 81

flutter google map marker for current position

How could I have goolge map's style marker for current location , it can even show the direction of current position ?

this is my code, the marker style of my code is just a pin, i want to have google map's marker style even to show the direction of current position .

 _markerSet.add(
    Marker(
      markerId: MarkerId('current_Postion'),
      infoWindow: InfoWindow(title: 'Current Position'),
      position: _userCurrentPositionLatLng,
      icon: BitmapDescriptor.defaultMarkerWithHue(
        BitmapDescriptor.hueGreen,
      ),
    ),

This is how my marker looks like enter image description here

This is the google marker which i want to have enter image description here

Any hints for suggestions?

Upvotes: 2

Views: 10596

Answers (1)

Akora Ing. DKB
Akora Ing. DKB

Reputation: 1051

Edit: Set myLocationEnabled: true, on the GoogleMap widget. It will automatically take care of that.

This works for a custom marker:
You cannot directly get the location from Google Map.
You can use this location package to get the users location (latitude and longitude) and then add the marker accordingly to the map.

Upvotes: 7

Related Questions