Reputation: 81
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
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