Commit 199d0fa8 authored by 7c00's avatar 7c00

Add iOS Marker#zIndex, Fix #145

parent 6d0e9479
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
BOOL _active; BOOL _active;
BOOL _canShowCallout; BOOL _canShowCallout;
BOOL _enabled; BOOL _enabled;
NSInteger _zIndex;
} }
- (instancetype)init { - (instancetype)init {
...@@ -92,6 +93,11 @@ ...@@ -92,6 +93,11 @@
_annotationView.enabled = !disabled; _annotationView.enabled = !disabled;
} }
- (void)setZIndex:(NSInteger)zIndex {
_zIndex = zIndex;
_annotationView.zIndex = zIndex;
}
- (MAPointAnnotation *)annotation { - (MAPointAnnotation *)annotation {
return _annotation; return _annotation;
} }
...@@ -117,14 +123,21 @@ ...@@ -117,14 +123,21 @@
_annotationView = [[MAPinAnnotationView alloc] initWithAnnotation:_annotation reuseIdentifier:nil]; _annotationView = [[MAPinAnnotationView alloc] initWithAnnotation:_annotation reuseIdentifier:nil];
((MAPinAnnotationView *) _annotationView).pinColor = _pinColor; ((MAPinAnnotationView *) _annotationView).pinColor = _pinColor;
} }
_annotationView.enabled = _enabled; _annotationView.enabled = _enabled;
_annotationView.canShowCallout = _canShowCallout; _annotationView.canShowCallout = _canShowCallout;
_annotationView.draggable = _draggable; _annotationView.draggable = _draggable;
_annotationView.customCalloutView = _calloutView; _annotationView.customCalloutView = _calloutView;
_annotationView.centerOffset = _centerOffset; _annotationView.centerOffset = _centerOffset;
if (_zIndex) {
_annotationView.zIndex = _zIndex;
}
if (_image != nil) { if (_image != nil) {
_annotationView.image = _image; _annotationView.image = _image;
} }
[self setActive:_active]; [self setActive:_active];
} }
return _annotationView; return _annotationView;
......
{ {
"name": "react-native-amap3d", "name": "react-native-amap3d",
"version": "0.10.0", "version": "0.10.1",
"description": "react-native 高德地图组件", "description": "react-native 高德地图组件",
"author": "Qiu Xiang <i@7c00.cc>", "author": "Qiu Xiang <i@7c00.cc>",
"license": "MIT", "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