copyWith method
Creates a copy of this marker annotation with optional property overrides.
This is useful for creating variations of an existing marker or for implementing undo/redo functionality.
Implementation
MarkerAnnotation copyWith({
String? id,
Offset? position,
MarkerType? markerType,
double? size,
Color? color,
String? tooltip,
int? zIndex,
bool? isVisible,
bool? isInteractive,
Map<String, dynamic>? metadata,
}) {
return MarkerAnnotation(
id: id ?? this.id,
position: position ?? this.position,
markerType: markerType ?? this.markerType,
markerSize: size ?? markerSize,
color: color ?? this.color,
tooltip: tooltip ?? this.tooltip,
zIndex: zIndex ?? this.zIndex,
isVisible: isVisible ?? this.isVisible,
isInteractive: isInteractive ?? this.isInteractive,
metadata: metadata ?? this.metadata,
);
}