mapView:viewForOverlay: 没有被调用

发布于 2024-10-02 14:20:49 字数 143 浏览 1 评论 0原文

我的地图视图有一个视图控制器。在 viewDidLoad 方法内,我将地图视图的委托设置为控制器(自身),然后添加 MKOverlay 对象。但我的 mapView:viewForOverlay: 方法没有被调用,所以我仍然无法在地图上显示任何内容。

谢谢

I have a view controller for my Map View. Inside the viewDidLoad method, I'm setting the mapview's delegate to the controller (self) and then I'm adding the MKOverlay object. But my mapView:viewForOverlay: method is not getting called, so I still can't get anything to display on my map.

Thanks

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

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

发布评论

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

评论(1

失而复得 2024-10-09 14:20:49

您可能没有正确设置 MKOverlay 上的坐标或boundingMapRect 属性。 MapView 仅在认为视图可能可见时才会请求视图,如果其可见矩形不与boundMapRect 相交,则不会。

Chances are you haven't set up the coordinate or boundingMapRect properties on the MKOverlay correctly. The MapView will only ask for the view if it thinks there is a possibility that it is visible, if its visible rect doesn't intersect the boundMapRect, it won't.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文