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;
[_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;
相关文章推荐
- IOS学习之NSNotificationCenter消息机制
- IOS开发资料汇总
- iOS的NSString常用方法总结
- iOS每个Cell倒计时
- Learning methods - 2
- iOS五种页面传值方式
- ios中的数据存储方式
- IOS开发根据字体大小等获取文字所占的高度
- iOS后台运行机制-实践总结
- ios 推送 证书配置
- iOS设置圆角性能问题
- [iPhone高级] 基于XMPP的IOS聊天客户端程序(IOS端三)
- nagios定义模板
- [iPhone高级] 基于XMPP的IOS聊天客户端程序(IOS端二)
- 在IOS中NSRange类的详细介绍
- [iPhone高级] 基于XMPP的IOS聊天客户端程序(IOS端一)
- ios 音乐播放器
- 状态栏颜色设置
- iOS本地化 NSLocalizedString的使用
- iOS开发——发短信,邮件