Commit ed2da651 authored by 7c00's avatar 7c00

Fix #49

parent f6bd0e81
......@@ -33,7 +33,6 @@
}
- (void)insertReactSubview:(id <RCTComponent>)subview atIndex:(NSInteger)atIndex {
[super insertReactSubview:subview atIndex:atIndex];
dispatch_async(dispatch_get_main_queue(), ^{
if ([subview isKindOfClass:[AMapMarker class]]) {
((AMapMarker *) subview).mapView = self;
......@@ -42,11 +41,11 @@
if ([subview isKindOfClass:[AMapModel class]]) {
[self addOverlay:(id <MAOverlay>) subview];
}
[super insertReactSubview:subview atIndex:atIndex];
});
}
- (void)removeReactSubview:(id <RCTComponent>)subview {
[super removeReactSubview:subview];
dispatch_async(dispatch_get_main_queue(), ^{
if ([subview isKindOfClass:[AMapMarker class]]) {
[self removeAnnotation:(id <MAAnnotation>) subview];
......@@ -54,6 +53,7 @@
if ([subview isKindOfClass:[AMapModel class]]) {
[self removeOverlay:(id <MAOverlay>) subview];
}
[super removeReactSubview:subview];
});
}
......
{
"name": "react-native-amap3d",
"version": "0.4.0",
"version": "0.4.1",
"description": "react-native 高德地图组件",
"author": "Qiu Xiang <i@7c00.cc>",
"license": "MIT",
......
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