私のiPhoneアプリケーションでは、CLLocationManagerを使って自分のiPhoneが指している方向を見つけています。私はプロパティ "見出し"を使用しています。それは私にx、y、z値を与えます。 これらの値から、現在指している方向(北または南または東または西)をどのようにして見つけることができますか?iPhone - CLHeading to direction
2
A
答えて
0
heading
は、CLHeading
オブジェクトです。ドキュメンテーションの一見があなたに語っていたように、それはまた真の見出しと磁気見出しのプロパティを度で持っています。
1
地方の北極または磁気北極に相対的な角度を取得するには、方法[locationManager startUpdateHeading]
を使用する必要があります。値を取得することができます
- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
{
NSLog(@"%f",newHeading.trueHeading);
}
関連する問題
- 1. Firemonkey to iPhone
- 2. Flash app to iPhone
- 3. OpenGL to iPhone on
- 4. NSData to NSString truncated - iPhone
- 5. Java Android onTouch Direction
- 6. geom_segment arrow direction
- 7. LTR Direction - office 2016
- 8. jquery .show( 'slow')direction?
- 9. Linux elf .text direction
- 10. YUV to RGB by Shader on iPhone
- 11. Facebook iPhone SDK Checking To Foursquare Place
- 12. iphoneアプリHow to wheel wheel animation
- 13. php base64 iphone picture to webservice
- 14. Python write(iPhone)Emoji to file
- 15. Google Maps Android V2とDirection API
- 16. Google Direction APIsエラー:REQUEST_DENIED
- 17. R arrow/direction plot from Data.frame
- 18. jQuery toggleClass with direction and animation
- 19. delphi TActionMainMenuBar Direction右から左
- 20. Google MapsのDirection Line Errors
- 21. SwiftでQibla Direction(方向のシンプルなコンパス)を見つけたい
- 22. 共有連絡先Via Twillion to iPhone
- 23. iPhone - Google To-Speachの特殊文字URL
- 24. iOS CoreLocation CLHeading - CLLocationへの見出しの更新
- 25. Direction/Sign x86命令セットのビット拡張
- 26. XamarinフォームとGoogle Direction APIの使い方
- 27. Architecture Direction Help:Azure Active Directory PAMモジュールの作成
- 28. Google Maps Direction Serviceゼロの結果
- 29. Native find north directionに反応します
- 30. focusSearch(int direction) - 方向の値ですか?
ありがとうございました。しかし、私は次のコードを使用して、値を印刷しようとしているとき、常に-1.00を常に印刷しています。 – Satyam
- (void)locationManager:(CLLocationManager *)マネージャdidUpdateHeading:(CLHeading *)newHeading { \t CLLocationDirection dir = [newHeading trueHeading]; – Satyam
どのように結果を印刷していますか? –