addMarker method

Future addMarker(
  1. LatLng position, {
  2. String? color,
  3. String? iconImage,
  4. double size = 1.0,
  5. Map<String, dynamic>? data,
  6. double opacity = 1.0,
  7. double? iconRotate,
  8. String? iconAnchor,
})

Adds a customizable marker at the given position on the map.

Supports customizing color, iconImage, size, and binding data. The optional opacity parameter (default 1.0) sets the initial visibility of the marker. Pass opacity: 0.0 to start invisible and fade in later using setMarkersOpacity.

Returns the internal Symbol or Circle reference.

Implementation

Future<dynamic> addMarker(
  LatLng position, {
  String? color,
  String? iconImage,
  double size = 1.0,
  Map<String, dynamic>? data,
  double opacity = 1.0,
  double? iconRotate,
  String? iconAnchor,
}) async {
  return await markers.addMarker(
    position,
    color: color,
    iconImage: iconImage,
    size: size,
    data: data,
    opacity: opacity,
    iconRotate: iconRotate,
    iconAnchor: iconAnchor,
  );
}