LabelMarker constructor

LabelMarker({
  1. required String label,
  2. required MarkerId markerId,
  3. required LatLng position,
  4. Color backgroundColor = Colors.blueAccent,
  5. TextStyle textStyle = const TextStyle(fontSize: 27.0, color: Colors.white, letterSpacing: 1.0, fontFamily: 'Roboto Bold'),
  6. double alpha = 1.0,
  7. Offset anchor = const Offset(0.5, 1.0),
  8. bool consumeTapEvents = false,
  9. bool draggable = false,
  10. bool flat = false,
  11. BitmapDescriptor icon = BitmapDescriptor.defaultMarker,
  12. InfoWindow infoWindow = InfoWindow.noText,
  13. double rotation = 0.0,
  14. bool visible = true,
  15. double zIndex = 0.0,
  16. VoidCallback? onTap,
  17. ValueChanged<LatLng>? onDrag,
  18. ValueChanged<LatLng>? onDragStart,
  19. 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,
});