2016-07-08 71 views
1

我在數據庫中查詢商店信息。我希望商店能夠在用戶當前位置周圍的某個半徑範圍內出現在屏幕上。當用戶移動時,我希望新的商店出現在屏幕上,用戶不必手動刷新任何東西。我應該使用什麼委託方法來查詢商店並將其放置在屏幕上?我如何在用戶移動時更新MKMapView上的引腳

回答

1

你只需要只func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -> MKAnnotationView?實施和聽與CLLocation Manager.Whenever新位置的位置變化出現的利益查詢點和追加的addAnnotations。經過到的MapView高於設定的MapView centerCoordinate屬性顯示在圖形頁面

用戶當前位置
1

可以使用centerCoordinate

var coord: CLLocationCoordinate2D = CLLocationCoordinate2DMake(map.centerCoordinate.latitude, map.centerCoordinate.longitude) 
相關問題