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

来源:互联网 发布:mac怎么换浏览器 编辑:程序博客网 时间:2024/05/16 03:35
  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;


0 0
原创粉丝点击