滚动显示自定义区域(高德地图)

来源:互联网 发布:java简历包装真实项目 编辑:程序博客网 时间:2024/06/07 05:37

///滚动显示自定义区域- (void)CenterWithCoordinate:(CLLocationCoordinate2D)coordinate animated:(BOOL)animated{    /*     CLLocationCoordinate2D theCenter;     MACoordinateRegion theRegin;     theCenter.latitude     = coordinate.latitude;     theCenter.longitude    = coordinate.longitude;     theRegin.center        = theCenter;          MACoordinateSpan theSpan;     theSpan.latitudeDelta  = 0.05;     theSpan.longitudeDelta = 0.05;     theRegin.span          = theSpan;     [self.mapView setRegion:theRegin];     [self.mapView regionThatFits:theRegin];     */        CLLocationCoordinate2D currentCoordinate = coordinate;        //设置显示区域 1 无缩放//    [self.mapView setCenterCoordinate:currentCoordinate animated:YES];        //设置显示区域 2    MACoordinateSpan span = {0.05, 0.05}; //显示范围精度    MACoordinateRegion region = {currentCoordinate, span}; //显示区域    [self.mapView setRegion:region animated:animated];}


0 0
原创粉丝点击