Commit 121f508a authored by 7c00's avatar 7c00

解决 #25

parent 98874aeb
......@@ -117,7 +117,4 @@ const styles = StyleSheet.create({
markerText: {
color: '#fff',
},
coloredImage: {
tintColor: '#e91e63',
},
})
......@@ -33,7 +33,8 @@
}
- (void)insertReactSubview:(id <RCTComponent>)subview atIndex:(NSInteger)atIndex {
[super insertReactSubview:(UIView *) subview atIndex:atIndex];
[super insertReactSubview:subview atIndex:atIndex];
dispatch_async(dispatch_get_main_queue(), ^{
if ([subview isKindOfClass:[AMapMarker class]]) {
((AMapMarker *) subview).mapView = self;
[self addAnnotation:(id <MAAnnotation>) subview];
......@@ -41,16 +42,19 @@
if ([subview isKindOfClass:[AMapModel class]]) {
[self addOverlay:(id <MAOverlay>) subview];
}
});
}
- (void)removeReactSubview:(id <RCTComponent>)subview {
[super removeReactSubview:(UIView *) subview];
[super removeReactSubview:subview];
dispatch_async(dispatch_get_main_queue(), ^{
if ([subview isKindOfClass:[AMapMarker class]]) {
[self removeAnnotation:(id <MAAnnotation>) subview];
}
if ([subview isKindOfClass:[AMapModel class]]) {
[self removeOverlay:(id <MAOverlay>) subview];
}
});
}
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment