Commit 1e430fe9 authored by 放牛的园子's avatar 放牛的园子

Merge branch '3-marker-icon-view' into 'wangqb_dev'

修复问题marker坐标不在屏幕内的时候全部集中在左上角的问题

See merge request !3
parents e398c156 cf0be5d5
......@@ -135,7 +135,7 @@
_annotationView.draggable = _draggable;
_annotationView.customCalloutView = _calloutView;
//设置中心点
if(_centerOffset.x == 0 && _centerOffset.y == 0)
if(_centerOffset.x == 0 && _centerOffset.y == 0 && _customView)
{
CGPoint point = CGPointMake(0, -_customView.bounds.size.height/2);
_annotationView.centerOffset = point;
......@@ -161,7 +161,12 @@
_annotationView.customCalloutView = _calloutView;
} else {
_customView = subview;
_customView.hidden = YES;
_annotationView = [[MAAnnotationView alloc] initWithAnnotation:_annotation reuseIdentifier:nil];
_annotationView.bounds = _customView.bounds;
[_annotationView addSubview:_customView];
[_annotationView addGestureRecognizer:[
[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_handleTap:)]];
//_customView.hidden = YES;
}
}
......
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