compass-geolocation

Android compass example does not seem to work in landscape mode

左心房为你撑大大i 提交于 2019-12-23 04:07:14
问题 I have developed a compass based on this example: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/Compass.html Since my app only operates in landscape mode so will the compass. However, it seems as this code does not function correctly in landscape mode. North points more towards east. If i run the Android example code I get the same issue. Has anyone else noticed this and even better does anyone have a solution? By the way, I am testing this on a

Using Compass to point to actual coordinate location instead of just North

我只是一个虾纸丫 提交于 2019-12-21 20:59:25
问题 I have seen a few examples of this but am not sure exactly how to implement it, (such as iPhone Compass GPS Direction) in do I need to call calcBearingWithLatitude in (void)startup? All I am trying to do is have the compass pull a point from memory and use that point as its "north" so to speak and point to it, no need for distance or anything like that. My implementation file as of now looks like @implementation TrackerViewController @synthesize locationManager; @synthesize compass;

Getting the difference between two headings

自作多情 提交于 2019-12-21 09:19:26
问题 I have this method for figuring out the difference between 2 0-360 compass headings. Although this works for figuring out how far absolutely (as in, always positive output) off I am, I am having trouble figuring out what needs to be done to introduce the sign into the output. Ideally, if the shortest distance from the initial heading to the final heading is by going around clockwise, I'd like the error to have a positive sign, if the shortest distance between the headings involves going

How to make compass point to my particular latitude longitude location based on my current location? [duplicate]

ε祈祈猫儿з 提交于 2019-12-21 06:17:47
问题 This question already has answers here : Calculate compass bearing / heading to location in Android (13 answers) Closed 4 years ago . I'm developing an android application where I want the compass to point to a particular latitude longitude position instead of the usual north location. Can anyone suggest how to implement this. I've developed an application which points to north direction. Thanks in advance in how to implement this. Any demo application which does this would be of great help.

Android accelerometer, sensor usage and power consumption

倾然丶 夕夏残阳落幕 提交于 2019-12-21 04:27:12
问题 I have a quick question about the accelerometer in Android devices. Is it always on/active? Given that accelerometer is used to detect the orientation of the device, either landscape or portrait. In the official documentation ( SensorManager ) it states that sensors should be turned off to save power. But I wonder if this only applies to others sensors like magnetic field sensors, gyroscope, light sensor and so on. I need to make a case for power conservation and I don't want to make the

Cardinal direction algorithm in Java

余生颓废 提交于 2019-12-20 10:29:54
问题 This weekend I spend a few minutes thrashing together an algorithm that would take in a heading (in degrees) and return a String for the cardinal direction (I'm using it in an android compass application I'm using). What I ended up with was this: private String headingToString(Float heading) { String strHeading = "?"; Hashtable<String, Float> cardinal = new Hashtable<String, Float>(); cardinal.put("North_1", new Float(0)); cardinal.put("Northeast", new Float(45)); cardinal.put("East", new

iOS augmented reality with compass and location

好久不见. 提交于 2019-12-20 09:45:46
问题 I'm trying to develop a mini "Around Me" like using camera, compass and location. I would like to display place's images on my screen. For the moment I have my location and my orientation with compass. I would like to know how can I determine the position of the place I want to display. Thanks for your help ;) 回答1: Once you have relative distance and bearing, which you can determine from two points in the same coordinate space using algorithms found on this page, figuring out where a known

accessing iPhone compass with JavaScript

我的梦境 提交于 2019-12-19 06:21:39
问题 Know if it's possible to access the iPhone compass in Safari using JavaScript? I see how the GPS can be accessed, but I can't figure out the compass. 回答1: You cannot access that information via javascript, unless you're using something like iPhoneGap At the time this was true, in iOS 5 you can use the compass heading in JS. https://developer.apple.com/documentation/webkitjs/deviceorientationevent/1804777-webkitcompassheading 回答2: On iOS , you can retrieve the compass value like this. window

accessing iPhone compass with JavaScript

跟風遠走 提交于 2019-12-19 06:21:13
问题 Know if it's possible to access the iPhone compass in Safari using JavaScript? I see how the GPS can be accessed, but I can't figure out the compass. 回答1: You cannot access that information via javascript, unless you're using something like iPhoneGap At the time this was true, in iOS 5 you can use the compass heading in JS. https://developer.apple.com/documentation/webkitjs/deviceorientationevent/1804777-webkitcompassheading 回答2: On iOS , you can retrieve the compass value like this. window

Use native iOS compass within an app

纵然是瞬间 提交于 2019-12-18 15:09:50
问题 Is it possible to use the native compass that iOS has within my own application? Or do I need to draw and animate my own compass? 回答1: There is no native compass UIView . In order to use the magnetometer, you'll have to use CoreLocation and the following delegate method: - (void) locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading to rotate a UIView to point North (bearingView is a UIImageView): float heading = newHeading.magneticHeading; //in degrees float