import '../entity/marker.dart';

enum MarkerType {
  mine(1),
  friend(2),
  traceStartPoint(3),
  traceEndFriendPoint(4),
  traceEndMinePoint(5),
  tracePopupPoint(6), //popup气泡样式
  tracePassingPoint(7), //轨迹途径点样式
  trackErrorPoint(8); //轨迹错误点样式

  final int value;

  const MarkerType(this.value);

  static MarkerType fromValue(int value) {
    return values.firstWhere(
      (type) => type.value == value,
      orElse: () => throw Exception('转换异常'),
    );
  }
}

typedef MarkerTapCallback = void Function(Marker marker);
