检测用户何时缩放到 Mapkit 允许的最小高度

发布于 2024-11-24 15:44:13 字数 45 浏览 2 评论 0原文

当用户缩放到 Mapkit 允许的最大级别时,我想显示所有图钉。 怎么做呢?

When a user zoom at the maximum level that Mapkit permits I want to show all the pins.
How to do that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱要勇敢去追 2024-12-01 15:44:13

通过在regionDidChange方法中监听地图span的longitudeDelta。
通过测试和记录,最小经度Delta似乎是0.000858。

- (void)mapView:(MKMapView *)aMapView regionDidChangeAnimated:(BOOL)animated{
    NSLog(@"Deltalong: %f", aMapView.region.span.longitudeDelta);
    if (aMapView.region.span.longitudeDelta <= 0.000858){
        //add your annotations
    }
}

By listening to the longitudeDelta of the maps span in the regionDidChange method.
Minimum longitudeDelta seems to be 0.000858 by testing and logging it.

- (void)mapView:(MKMapView *)aMapView regionDidChangeAnimated:(BOOL)animated{
    NSLog(@"Deltalong: %f", aMapView.region.span.longitudeDelta);
    if (aMapView.region.span.longitudeDelta <= 0.000858){
        //add your annotations
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文