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

解决 #25

parent 98874aeb
...@@ -117,7 +117,4 @@ const styles = StyleSheet.create({ ...@@ -117,7 +117,4 @@ const styles = StyleSheet.create({
markerText: { markerText: {
color: '#fff', color: '#fff',
}, },
coloredImage: {
tintColor: '#e91e63',
},
}) })
...@@ -33,24 +33,28 @@ ...@@ -33,24 +33,28 @@
} }
- (void)insertReactSubview:(id <RCTComponent>)subview atIndex:(NSInteger)atIndex { - (void)insertReactSubview:(id <RCTComponent>)subview atIndex:(NSInteger)atIndex {
[super insertReactSubview:(UIView *) subview atIndex:atIndex]; [super insertReactSubview:subview atIndex:atIndex];
if ([subview isKindOfClass:[AMapMarker class]]) { dispatch_async(dispatch_get_main_queue(), ^{
((AMapMarker *) subview).mapView = self; if ([subview isKindOfClass:[AMapMarker class]]) {
[self addAnnotation:(id <MAAnnotation>) subview]; ((AMapMarker *) subview).mapView = self;
} [self addAnnotation:(id <MAAnnotation>) subview];
if ([subview isKindOfClass:[AMapModel class]]) { }
[self addOverlay:(id <MAOverlay>) subview]; if ([subview isKindOfClass:[AMapModel class]]) {
} [self addOverlay:(id <MAOverlay>) subview];
}
});
} }
- (void)removeReactSubview:(id <RCTComponent>)subview { - (void)removeReactSubview:(id <RCTComponent>)subview {
[super removeReactSubview:(UIView *) subview]; [super removeReactSubview:subview];
if ([subview isKindOfClass:[AMapMarker class]]) { dispatch_async(dispatch_get_main_queue(), ^{
[self removeAnnotation:(id <MAAnnotation>) subview]; if ([subview isKindOfClass:[AMapMarker class]]) {
} [self removeAnnotation:(id <MAAnnotation>) subview];
if ([subview isKindOfClass:[AMapModel class]]) { }
[self removeOverlay:(id <MAOverlay>) subview]; if ([subview isKindOfClass:[AMapModel class]]) {
} [self removeOverlay:(id <MAOverlay>) subview];
}
});
} }
@end @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