Commit 4bded8e5 authored by 7c00's avatar 7c00

优化 Marker#disabled 接口

parent 2253a7e7
......@@ -20,6 +20,7 @@
- (instancetype)init {
_annotation = [MAPointAnnotation new];
_canShowCallout = YES;
self = [super init];
return self;
}
......@@ -79,13 +80,9 @@
}
}
- (void)setClickable:(BOOL)enabled {
_annotationView.enabled = enabled;
}
- (void)setInfoWindowEnabled:(BOOL)enabled {
_canShowCallout = enabled;
_annotationView.canShowCallout = enabled;
- (void)setDisabled:(BOOL)disabled {
_canShowCallout = !disabled;
_annotationView.canShowCallout = _canShowCallout;
}
- (MAPointAnnotation *)annotation {
......
......@@ -21,8 +21,7 @@ RCT_EXPORT_VIEW_PROPERTY(title, NSString)
RCT_EXPORT_VIEW_PROPERTY(description, NSString)
RCT_EXPORT_VIEW_PROPERTY(active, BOOL)
RCT_EXPORT_VIEW_PROPERTY(draggable, BOOL)
RCT_EXPORT_VIEW_PROPERTY(clickable, BOOL)
RCT_EXPORT_VIEW_PROPERTY(infoWindowEnabled, BOOL)
RCT_EXPORT_VIEW_PROPERTY(disabled, BOOL)
RCT_EXPORT_VIEW_PROPERTY(zIndex, NSInteger)
RCT_EXPORT_VIEW_PROPERTY(color, MAPinAnnotationColor)
RCT_EXPORT_VIEW_PROPERTY(image, NSString)
......@@ -43,7 +42,7 @@ RCT_EXPORT_METHOD(lockToScreen:(nonnull NSNumber *)reactTag x:(int)x y:(int)y) {
RCT_EXPORT_METHOD(active:(nonnull NSNumber *)reactTag) {
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
AMapMarker *marker = (AMapMarker *) viewRegistry[reactTag];
[marker setActive: true];
marker.active = YES;
}];
}
......
......@@ -66,11 +66,6 @@ export default class Marker extends BaseComponent {
*/
draggable: PropTypes.bool,
/**
* 是否可点击
*/
clickable: PropTypes.bool,
/**
* 是否平贴地图
*/
......@@ -103,9 +98,9 @@ export default class Marker extends BaseComponent {
active: PropTypes.bool,
/**
* 是否启用信息窗体
* 是否禁用,禁用后不可点击
*/
infoWindowEnabled: PropTypes.bool,
disabled: PropTypes.bool,
/**
* 点击事件
......
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