ios 高德地图 setVisibleMapRect 设置可见区域

如图使用 polyline 绘制路径, 绘制完成后将路径显示在地图中心区域

实现代码: 

let polyline: MAPolyline = MAPolyline(coordinates: &tempArr, count: UInt(tempArr.count))
        mapView.add(polyline)
        
        //设置地图可见区域
        let padding = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)
        mapView.setVisibleMapRect(polyline.boundingMapRect, edgePadding: padding, animated: true)
发布了79 篇原创文章 · 获赞 9 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/LeeCSDN77/article/details/94584248