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

本文介绍了如何使用BMKMapView进行地图配置,包括设置缩放级别、显示比例尺及当前位置等,并详细解释了如何调整注释视图的位置属性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  1.   BMKMapView *mapView=[[BMKMapView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
  2.         [_mapView setZoomEnabled:YES];
  3.         [_mapView setZoomLevel:10];//级别,3-19
  4.         mapView.showMapScaleBar = YES;//比例尺
  5.         mapView.mapScaleBarPosition = CGPointMake(10,mapView.frame.size.height-45);//比例尺的位置
  6.         mapView.showsUserLocation=YES;//显示当前设备的位置
  7.         mapView.userTrackingMode = BMKUserTrackingModeFollow;//定位跟随模式
  8.         [mapView setMapType:BMKMapTypeStandard];//地图的样式(标准地图)
  9.         mapView.delegate = self;
  10.         _mapView = mapView;
  11.         [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;


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值