0
我的計算有點問題。計算mapcenter,以便移動註釋(gps)仍然保持在屏幕上的可見視圖中
我想要的是應用程序的用戶在地圖可見區域的某處放置移動的地圖註記。雖然註釋位置正在改變(GPS單位),但地圖應該移動,但引腳始終保持在屏幕上的該點。
使用效果和
-(CLLocationDistance) calcluateDistance:(CLLocationCoordinate2D)annotationLocation{
CLLocation *annotationPosition = [[[CLLocation alloc]initWithLatitude:annotationLocation.latitude longitude:annotationLocation.longitude]autorelease];
CLLocation *centrePosition = [[CLLocation alloc]initWithLatitude:self.mapView.centerCoordinate.latitude longitude:self.mapView.centerCoordinate.longitude];
CLLocationDistance distance = [centrePosition distanceFromLocation:trackerPosition];
return distance;
}
導致扔成果轉化爲this stackoverflow anser
自己是不是真正的工作。我知道我的解釋是不是superclear所以請問我,如果有不清楚的地方:)
五月感謝