LabelMarker constructor
LabelMarker({
- required String label,
- required MarkerId markerId,
- required LatLng position,
- Color backgroundColor = Colors.blueAccent,
- TextStyle textStyle = const TextStyle(fontSize: 27.0, color: Colors.white, letterSpacing: 1.0, fontFamily: 'Roboto Bold'),
- double alpha = 1.0,
- Offset anchor = const Offset(0.5, 1.0),
- bool consumeTapEvents = false,
- bool draggable = false,
- bool flat = false,
- BitmapDescriptor icon = BitmapDescriptor.defaultMarker,
- InfoWindow infoWindow = InfoWindow.noText,
- double rotation = 0.0,
- bool visible = true,
- double zIndex = 0.0,
- VoidCallback? onTap,
- ValueChanged<
LatLng> ? onDrag, - ValueChanged<
LatLng> ? onDragStart, - ValueChanged<
LatLng> ? onDragEnd,
Creates a marker with text label
- Pass the label to be displayed on the marker
- Pass the markerId to be used as a key for the marker
- Pass the position to be used as the marker's position
- Optionally pass the backgroundColor to be used as the marker's background color
- Optionally pass the textStyle to be used as the marker's text style
- Optionally you could pass all the other parameters passed for a normal marker
Implementation
LabelMarker({
required this.label,
required this.markerId,
required this.position,
this.backgroundColor = Colors.blueAccent,
this.textStyle = const TextStyle(
fontSize: 27.0,
color: Colors.white,
letterSpacing: 1.0,
fontFamily: 'Roboto Bold',
),
this.alpha = 1.0,
this.anchor = const Offset(0.5, 1.0),
this.consumeTapEvents = false,
this.draggable = false,
this.flat = false,
this.icon = BitmapDescriptor.defaultMarker,
this.infoWindow = InfoWindow.noText,
this.rotation = 0.0,
this.visible = true,
this.zIndex = 0.0,
this.onTap,
this.onDrag,
this.onDragStart,
this.onDragEnd,
});