gpt4 book ai didi

ios - didChangeCameraPosition 获取可用坐标的边界框/矩形

转载 作者:可可西里 更新时间:2023-11-01 03:27:42 24 4
gpt4 key购买 nike

如何从 GMSCameraPosition 检索 GMSCoordinateBounds?每次用户移动相机时,我都想知道 map 上的可见坐标(至少是东北/西南点),如下所示:

(void)mapView:(GMSMapView *)mapView didChangeCameraPosition:(GMSCameraPosition *)position

最佳答案

GMSVisibleRegion visibleRegion = mapView.projection.visibleRegion;
GMSCoordinateBounds *bounds = [[GMSCoordinateBounds alloc] initWithRegion:visibleRegion];

// we've got what we want, but here are NE and SW points
CLLocationCoordinate2D northEast = bounds.northEast;
CLLocationCoordinate2D southWest = bounds.southWest;

关于ios - didChangeCameraPosition 获取可用坐标的边界框/矩形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23770999/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com