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,
Set<String>? dependencies,
Map<String, dynamic>? metadata,
}) {
return MarkerAnnotation(
id: id ?? this.id,
position: position ?? currentPosition,
markerType: markerType ?? this.markerType,
markerSize: size ?? markerSize,
color: color ?? this.color,
tooltip: tooltip ?? this.tooltip,
zIndex: zIndex ?? currentZIndex,
isVisible: isVisible ?? currentIsVisible,
isInteractive: isInteractive ?? this.isInteractive,
dependencies: dependencies ?? this.dependencies.toSet(),
metadata: metadata ?? this.metadata,
);
}