开发者社区 问答 正文

关于MKMapRectMake缩放 的问题

MKMapRectMake标记东北和西南显示区域。

我能否设置之后将地图缩放一点?

routeRect = MKMapRectMake(southWestPoint.x, southWestPoint.y, northEastPoint.x - southWestPoint.x, northEastPoint.y - southWestPoint.y);
[self.mapView setVisibleMapRect:routeRect];

应该如何对地图进行缩放?

展开
收起
爵霸 2016-03-17 11:54:57 2373 分享
分享
版权
举报
1 条回答
写回答
取消 提交回答
  • MKCoordinateRegion region = MKCoordinateRegionForMapRect(routeRect);
    MKCoordinateSpan span;
    span.latitudeDelta = 0.09;
    span.longitudeDelta = 0.09;
    region.span = span;
    region = [self.mapView regionThatFits:region];
    [_mapView setRegion:region animated:YES];
    
    2019-07-17 19:05:03 举报
    赞同 评论

    评论

    全部评论 (0)

    登录后可评论
问答分类:
问答地址:
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等