任何人都可以解釋如何將MKMapPoint轉換爲CGPoint嗎?我需要在UIView上使用經度和緯度繪製路徑。如何將MKMapPoint轉換爲CGPoint
0
A
回答
-4
更新答案.......
CGPoint newCenter = [self.mapView convertCoordinate:coordinates toPointToView:self.mapView];
13
接受的答案覆羽CLLocationCoordinate2D到CGPoint,這是不是被要求在實際的問題。對於那些在這裏尋找完整答案的人:
MKMapPoint mapPoint = MKMapPointMake(22.1, 34.4);//example
//first convert MKMapPoint to CLLocationCoordinate2D
CLLocationCoordinate2D mapPointCoordinate = MKCoordinateForMapPoint(mapPoint);
//second convert CLLocationCoordinate2D to CGPoint
CGPoint pointAsCGPoint = [self.mapView convertCoordinate: mapPointCoordinate toPointToView: self.mapView];
+0
之前任何人downvotes:接受的答案在我的文章後編輯,所以現在看起來像我的文章是副本。相信upvotes :) – pnizzle
相關問題
- 1. iPhone SDK:將MKMapPoint轉換爲CGPoint
- 2. MKMapPoint到CGPoint
- 3. Swift:你如何將CGPoint轉換爲CLLocationCoordinate2D
- 4. 如何將值轉換爲CGPoint?
- 5. iphone - 將MKMapPoint距離轉換爲米
- 6. 將CLLocation對象轉換爲MKMapPoint結構
- 7. iOS:如何將MKMapPoint或CLLocationCoordinate2D轉換爲UTM?
- 8. 如何將MKMapPoint數組轉換爲MKPolygon覆蓋圖
- 9. 將OpenCV關鍵點轉換爲CGPoint
- 10. 在Objective-C中將CGPoint轉換爲GLKVector2
- 11. 將CLLocationCoordinate2D座標轉換爲CGPoint Swift
- 12. 將CGPoint從UIView轉換爲AVCaptureVideoPreviewLayer
- 13. 將CLLocation或CLLocationCoordinate2D轉換爲CGPoint
- 14. 如何在iPhone中將NSString轉換爲CGPoint
- 15. 如何將視圖寬度和高度轉換爲CGPoint座標?
- 16. Swift:如何將String列表轉換爲CGPoint列表?
- 17. 如何將id類型轉換爲CGPoint類型?
- 18. 如何在swift中將NSValue中的CGPoint轉換?
- 19. 轉換一個CGPoint至NSValue
- 20. 從地圖座標得到CGPoint或從MKMapPoint iphone
- 21. Apple提供了將CGSize轉換爲CGPoint的功能嗎?
- 22. 將CGPoint轉換爲字符串的問題
- 23. 將CGPoint從UIView座標系轉換爲CALayer座標系
- 24. 將CGPoint伊娃的'x'值轉換爲NSTimeInterval?
- 25. 仿射轉換可防止CGPoint轉移
- 26. 如何將錢轉換爲
- 27. 可能將CGVector轉換爲CGPoint,因爲它們具有相同的大小?
- 28. 我如何將cgpoint轉爲cgrect或如何設置calayer的中心?
- 29. 轉換從CIFaceFeature返回的CGPoint結果
- 30. 如何在vector_float2和CGPoint *之間進行轉換?
給出OP a -1,因爲接受的答案沒有采用他們想要轉換的類型。對於我們這些人尋找原始問題的答案毫無幫助。 – bobsmells
請不要複製他人的答案。 – Matt
@Matt是的,但我之前發佈的答案不是。它不復制我只修改它。 –