您的位置:首页 > 移动开发 > IOS开发

iOS百度地图比例,及自定义popview图片偏移设置

2016-05-16 18:33 411 查看
BMKMapView *mapView=[[BMKMapView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];

[_mapView setZoomEnabled:YES];

[_mapView setZoomLevel:10];//级别,3-19

mapView.showMapScaleBar = YES;//比例尺

mapView.mapScaleBarPosition = CGPointMake(10,mapView.frame.size.height-45);//比例尺的位置

mapView.showsUserLocation=YES;//显示当前设备的位置

mapView.userTrackingMode = BMKUserTrackingModeFollow;//定位跟随模式

[mapView setMapType:BMKMapTypeStandard];//地图的样式(标准地图)

mapView.delegate = self;

_mapView = mapView;

[self.view addSubview:_mapView];

annotationView.calloutOffset =
CGPointMake(30,
0);
进去看看

///关联的annotation

@property (nonatomic,
strong) id <BMKAnnotation> annotation;

///annotation view显示的图像

@property (nonatomic,
strong) UIImage *image;

///默认情况下, annotation view的中心位于annotation的坐标位置,可以设置centerOffset改变view的位置,正的偏移使view朝右下方移动,负的朝左上方,单位是像素

@property (nonatomic)
CGPoint centerOffset;

///默认情况下,
弹出的气泡位于view正中上方,可以设置calloutOffset改变view的位置,正的偏移使view朝右下方移动,负的朝左上方,单位是像素

@property (nonatomic)
CGPoint calloutOffset;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: