@@ -92,19 +92,36 @@ - (void)removeReactSubview:(id<RCTComponent>)subview {
92
92
}
93
93
[_reactSubviews removeObject: (UIView *)subview];
94
94
}
95
+
95
96
- (NSArray <id<RCTComponent>> *)reactSubviews {
96
97
return _reactSubviews;
97
98
}
98
99
99
100
- (void )mapViewIdle : (nonnull NMFMapView *)mapView {
100
101
if (((RNNaverMapView*)self).onCameraChange != nil )
101
102
((RNNaverMapView*)self).onCameraChange (@{
102
- @" latitude" : @(mapView.cameraPosition .target .lat ),
103
- @" longitude" : @(mapView.cameraPosition .target .lng ),
104
- @" zoom" : @(mapView.cameraPosition .zoom )
103
+ @" latitude" : @(mapView.cameraPosition .target .lat ),
104
+ @" longitude" : @(mapView.cameraPosition .target .lng ),
105
+ @" zoom" : @(mapView.cameraPosition .zoom ),
106
+ @" contentRegion" : pointsToJson (mapView.contentRegion .exteriorRing .points ),
107
+ @" coveringRegion" : pointsToJson (mapView.coveringRegion .exteriorRing .points ),
105
108
});
106
109
}
107
110
111
+ static NSArray * pointsToJson (NSArray <NMGLatLng*> *points) {
112
+ NSMutableArray *array = [NSMutableArray array ];
113
+ for (int i = 0 ; i < points.count ; i++)
114
+ [array addObject: toJson (points[i])];
115
+ return array;
116
+ }
117
+
118
+ static NSDictionary * toJson (NMGLatLng * _Nonnull latlng) {
119
+ return @{
120
+ @" latitude" : @(latlng.lat ),
121
+ @" longitude" : @(latlng.lng ),
122
+ };
123
+ }
124
+
108
125
- (void )didTapMapView : (CGPoint )point LatLng : (NMGLatLng *)latlng {
109
126
if (((RNNaverMapView*)self).onMapClick != nil )
110
127
((RNNaverMapView*)self).onMapClick (@{
@@ -123,4 +140,6 @@ - (void)mapView:(nonnull NMFMapView *)mapView regionWillChangeAnimated:(BOOL)ani
123
140
});
124
141
}
125
142
143
+
144
+
126
145
@end
0 commit comments