@@ -35,11 +35,12 @@ namespace rnoh {
35
35
MAP_PRESS = 1 ,
36
36
MAP_LONG_PRESS = 2 ,
37
37
MAP_REGION_CHANGE = 3 ,
38
- MAP_MARKER_PRESS = 4 ,
39
- MAP_MARKER_DRAG = 5 ,
40
- MAP_MARKER_DRAG_START = 6 ,
41
- MAP_MARKER_DRAG_END = 7 ,
42
- MAP_POI = 8 ,
38
+ MAP_REGION_CHANGE_COMPLETE = 4 ,
39
+ MAP_MARKER_PRESS = 5 ,
40
+ MAP_MARKER_DRAG = 6 ,
41
+ MAP_MARKER_DRAG_START = 7 ,
42
+ MAP_MARKER_DRAG_END = 8 ,
43
+ MAP_POI = 9 ,
43
44
};
44
45
45
46
AIRMapEventType getAIRMapEventType (ArkJS &arkJs, napi_value eventObject) {
@@ -52,6 +53,8 @@ namespace rnoh {
52
53
return AIRMapEventType::MAP_LONG_PRESS;
53
54
} else if (eventType == " onRegionChange" ) {
54
55
return AIRMapEventType::MAP_REGION_CHANGE;
56
+ } else if (eventType == " onRegionChangeComplete" ) {
57
+ return AIRMapEventType::MAP_REGION_CHANGE_COMPLETE;
55
58
} else if (eventType == " onMarkerPress" ) {
56
59
return AIRMapEventType::MAP_MARKER_PRESS;
57
60
} else if (eventType == " onMarkerDrag" ) {
@@ -115,6 +118,17 @@ class AIRMapEventEmitRequestHandler : public EventEmitRequestHandler {
115
118
react::AIRMapEventEmitter::onRegionEvent event{region};
116
119
eventEmitter->onRegionChange (event);
117
120
} break ;
121
+ case AIRMapEventType::MAP_REGION_CHANGE_COMPLETE: {
122
+ auto _region = arkJs.getObjectProperty (ctx.payload , " region" );
123
+ facebook::react::Region region = {
124
+ (float )arkJs.getDouble (arkJs.getObjectProperty (_region, " latitude" )),
125
+ (float )arkJs.getDouble (arkJs.getObjectProperty (_region, " longitude" )),
126
+ (float )arkJs.getDouble (arkJs.getObjectProperty (_region, " longitudeDelta" )),
127
+ (float )arkJs.getDouble (arkJs.getObjectProperty (_region, " longitudeDelta" ))
128
+ };
129
+ react::AIRMapEventEmitter::onRegionEvent event{region};
130
+ eventEmitter->onRegionChangeComplete (event);
131
+ } break ;
118
132
case AIRMapEventType::MAP_MARKER_PRESS: {
119
133
auto _coordinate = arkJs.getObjectProperty (ctx.payload , " coordinate" );
120
134
facebook::react::Coordinate coordinate = {
@@ -123,31 +137,31 @@ class AIRMapEventEmitRequestHandler : public EventEmitRequestHandler {
123
137
react::AIRMapEventEmitter::onPressEvent event{coordinate};
124
138
eventEmitter->onMarkerPress (event);
125
139
} break ;
126
- case AIRMapEventType::MAP_MARKER_DRAG: {
140
+ case AIRMapEventType::MAP_MARKER_DRAG: {
127
141
auto _coordinate = arkJs.getObjectProperty (ctx.payload , " coordinate" );
128
142
facebook::react::Coordinate coordinate = {
129
143
(float )arkJs.getDouble (arkJs.getObjectProperty (_coordinate, " latitude" )),
130
144
(float )arkJs.getDouble (arkJs.getObjectProperty (_coordinate, " longitude" ))};
131
145
react::AIRMapEventEmitter::onPressEvent event{coordinate};
132
146
eventEmitter->onMarkerDrag (event);
133
147
} break ;
134
- case AIRMapEventType::MAP_MARKER_DRAG_START: {
148
+ case AIRMapEventType::MAP_MARKER_DRAG_START: {
135
149
auto _coordinate = arkJs.getObjectProperty (ctx.payload , " coordinate" );
136
150
facebook::react::Coordinate coordinate = {
137
151
(float )arkJs.getDouble (arkJs.getObjectProperty (_coordinate, " latitude" )),
138
152
(float )arkJs.getDouble (arkJs.getObjectProperty (_coordinate, " longitude" ))};
139
153
react::AIRMapEventEmitter::onPressEvent event{coordinate};
140
154
eventEmitter->onMarkerDragStart (event);
141
155
} break ;
142
- case AIRMapEventType::MAP_MARKER_DRAG_END: {
156
+ case AIRMapEventType::MAP_MARKER_DRAG_END: {
143
157
auto _coordinate = arkJs.getObjectProperty (ctx.payload , " coordinate" );
144
158
facebook::react::Coordinate coordinate = {
145
159
(float )arkJs.getDouble (arkJs.getObjectProperty (_coordinate, " latitude" )),
146
160
(float )arkJs.getDouble (arkJs.getObjectProperty (_coordinate, " longitude" ))};
147
161
react::AIRMapEventEmitter::onPressEvent event{coordinate};
148
162
eventEmitter->onMarkerDragEnd (event);
149
163
} break ;
150
- case AIRMapEventType::MAP_POI: {
164
+ case AIRMapEventType::MAP_POI: {
151
165
auto _coordinate = arkJs.getObjectProperty (ctx.payload , " coordinate" );
152
166
facebook::react::Coordinate coordinate = {
153
167
(float )arkJs.getDouble (arkJs.getObjectProperty (_coordinate, " latitude" )),
0 commit comments