Skip to content

Commit

Permalink
统一处理 overlay 属性更新的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
lovebing committed May 17, 2020
1 parent 0df205d commit 9d514d2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 0 additions & 6 deletions ios/RCTBaiduMap/Views/OverlayMarker.m
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,6 @@ - (void)removeReactSubview:(UIView *)subview {
[super removeReactSubview:subview];
}

- (void)didSetProps:(NSArray<NSString *> *)props {
NSLog(@"marker didSetProps:%@", props);
[super didSetProps:props];
[self update];
}

- (void)didUpdateReactSubviews {
NSLog(@"didUpdateReactSubviews:%lu", (unsigned long)[self.reactSubviews count]);
[super didUpdateReactSubviews];
Expand Down
1 change: 1 addition & 0 deletions ios/RCTBaiduMap/Views/OverlayView.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#import <BaiduMapAPI_Map/BMKMapView.h>
#import <BaiduMapAPI_Map/BMKPointAnnotation.h>
#import <React/RCTConvert+CoreLocation.h>
#import <React/UIView+React.h>

@interface OverlayView : UIView

Expand Down
6 changes: 6 additions & 0 deletions ios/RCTBaiduMap/Views/OverlayView.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ - (void)update {

}

- (void)didSetProps:(NSArray<NSString *> *)props {
NSLog(@"overlay didSetProps:%@", props);
[super didSetProps:props];
[self update];
}

- (void)setStroke:(NSDictionary *)stroke {
self.lineWidth = [RCTConvert double:stroke[@"width"]];
self.strokeColor = [RCTConvert NSString:stroke[@"color"]];
Expand Down

0 comments on commit 9d514d2

Please sign in to comment.