如何观察iOS mapView didChangeVisibleRegion



你好,我正在开发一个应用程序,该应用程序将显示用户当前放大到的位置的注释,但我不知道如何使用其中一个函数,因为我对mapkit还很陌生。

func mapViewDidChangeVisibleRegion(_ mapView: MKMapView) {
if mapView.region.span.latitudeDelta = ?
}

我使用firebase,不想拉出所有输入的注释,只想在用户处于一定缩放比例时拉出注释并显示这些注释。这是我空白的地方,问号是我不知道该输入什么的地方。如果有人知道,请帮忙!?非常感谢。

我不使用swift,所以我不能提供实际的编码。。。。但是编码应该如何工作。这一切都可以在HTTP请求线程中执行。

func mapViewDidChangeVisibleRegion(_mapView:MKMapView({/*应用程序端*///HTTP方法在此处传递mapView.region.span.latitudeDelta和mapView.reregion.span.longitudeDelta

/* server side */
// Do math from the delta values passed
// Query the database based off the math
// Output data in json format
/* App side */
// Redraw the map annotations based of the json output

}

最新更新