1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
| import 'location_model.dart';
|
| class MapShowInfo {
| final SimpleLocation center;
| final int zoomLevel;
|
| MapShowInfo(this.center, this.zoomLevel);
| }
|
| class Marker {
| String? _id;
| SimpleLocation position;
| String icon;
| int? zIndex;
| double? width;
| double? height;
| Offset? centerOffset;
|
| Marker(
| {required this.position,
| required this.icon,
| String? id,
| this.zIndex,
| this.width,
| this.height,
| this.centerOffset}) {
| if (id == null) {
| var timeStamp = DateTime.now().millisecondsSinceEpoch;
| _id = '$timeStamp' '_' '$hashCode';
| } else {
| _id = id;
| }
| }
|
| /// 获取id
| String get Id => _id!;
|
| Map<String, Object?> toMap() {
| Map<String, Object?> map = {
| 'id': Id,
| 'position': position.toJson(),
| 'zIndex': zIndex,
| 'icon': icon,
| };
| if (width != null) {
| map["width"] = width;
| }
|
| if (height != null) {
| map["height"] = height;
| }
|
| if (centerOffset != null) {
| map["centerOffset"] = centerOffset!.toMap();
| }
|
| return map;
| }
| }
|
| class Offset {
| double x;
| double y;
|
| Offset(this.x, this.y);
|
| Map<String, Object?> toMap() {
| Map<String, Object?> map = {'x': x, 'y': y};
| return map;
| }
| }
|
| class MapClickEventBus {
| SimpleLocation? location;
|
| MapClickEventBus(this.location);
| }
|
| class CaptureEventBus {
| String path;
| CaptureEventBus(this.path);
| }
|
| class Coordinate {
| final double latitude;
| final double longitude;
|
| Coordinate(this.latitude, this.longitude);
| }
|
|