compass-geolocation

In Android can I programmatically detect that the compass is not yet calibrated?

时光总嘲笑我的痴心妄想 提交于 2019-12-18 10:59:42
问题 I've found that when I start up my game the compass is often out of whack. Objects will fly around and not be where they're supposed to be. But, if I move the phone in a figure eight (or just wave it round in random directions) everything snaps into place within perhaps half a minute. Does the hardware know when the compass is not calibrated? Would it be possible for me to detect this and pop up a message telling the user "Your android's compass needs to be calibrated. Please move the phone

Using orientation sensor to point towards a specific location

拥有回忆 提交于 2019-12-17 17:58:29
问题 I'm trying to implement an arrow that uses the orientation sensor in order to point towards a specific location. Google Places implements this arrow in a ListView for each place it finds. I've managed to get the azimuth, but given a location, I don't know how to proceed to calculate the angle I need. Moreover, I need to make the conversions from real north and magnetic north. Does anybody have an example of such implementation? Thanks in advance. 回答1: I solved it. float azimuth = // get

Show wind direction on Google Maps

邮差的信 提交于 2019-12-17 15:41:47
问题 I calculated the wind direction and now I want to show the wind direction pointing to 144 degrees (on compass). How can I show this arrow on Google Maps? 回答1: In order to show an arrow over a google map you can create a Rich Marker that embed an image using the google-maps-utility-library-v3, Next apply a rotation in degree to the image element with css3 tranformations. In example : // content element of a rich marker var richMarkerContent = document.createElement('div'); // arrow image var

How to rotate a Direction Arrow to particular location

喜夏-厌秋 提交于 2019-12-17 10:35:12
问题 In my app I have a latitude-longitude of 1 fix location. Now user with iPhone device can move anywhere and even he rotate his device, the arrow (some uiimageview) should point to that fix location so User will get direction to that location every time. I tried as follows. -(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { CLLocationCoordinate2D here = newLocation.coordinate; [self calculateUserAngle:here];

Compass spinning javascript problem with angle - rotate/translate

时光怂恿深爱的人放手 提交于 2019-12-13 02:28:06
问题 i'm building a compass for the iphone, duh, just for experiment purpose and to learn how to do it, in javascript, with phonegap. now i'm already able to get the degrees, i was able to apply the deg 0-360 to a div (let's call it the "wheel") using the webkit-transform translateZ (or i could use rotate) but i have a bug: when the wheel goes from 0deg to 359deg everything is ok, but when the degree goes to 0deg again, instead of smoothly spin in that direction (clockwise), it spin rapidly again

Adding Compass to Rotate MapView

自作多情 提交于 2019-12-12 02:57:55
问题 I'm using the code of MapsDemo Sample to draw a Map that rotates according to the compass, but enableCompass is not working to show the compass on MapView. I tried to add this compass http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/Compass.html. But when I add it to my application, the arrow appears frozen. Any ideas? 回答1: Bear in mind that it will only work on actual hardware. Put this line in onCreate : MyLocationOverlay me = new

How type TYPE_ACCELEROMETER and TYPE_MAGNETIC_FIELD used to make compass on android devices

孤街醉人 提交于 2019-12-11 07:15:36
问题 I am working on an application which uses compass although I successfully implemented it but there is no such brief explanation that how it works . Like how the TYPE_ACCELEROMETER and TYPE_MAGNETIC_FIELD was used to get the orientation. I know we did get it and the zero index of the array we got is the azimuth from which we get the degree and came to know where north is. But how it get to this all. Can anyone explain please? Secondly what if I place my mobile on the floor suppose it points in

How to get phone heading for augmented reality?

三世轮回 提交于 2019-12-11 02:22:42
问题 Possible duplicate : Android getOrientation Azimuth gets polluted when phone is tilted I am new to android development and I try to get the user facing. After searching on the web I am pretty sure I need to use remapCoordinateSystem , android documentation say it is good to use for an augmented reality app. I try to use some existing code to be sure that is a good way. (Finally I want to create an augmented reality application) The following code should return the user facing in degree : Code

Access device compass from webb app with Javascript

眉间皱痕 提交于 2019-12-10 21:19:09
问题 Is it possible to access the compass with Javascript on an iphone/ android device from a web app? Have been looking all over the net for hours I know you can access the accelerometer with window.ondevicemotion = function(event) Does anyone know if you can access the information from the compass?? 回答1: On iPhone, you can get the compass value like this. window.addEventListener('deviceorientation', function(e) { console.log(e.webkitCompassHeading); }, false); Hope this help. 回答2: It looks to be

Compass direction is different depending on phone orientation

a 夏天 提交于 2019-12-09 17:58:29
问题 My augmented reality app needs the compass bearing of the camera view, and there's plenty of examples of getting the direction from the sensormanager. However I'm finding the resulting value different depending on the phone orientation - landscape rotated to right is about 10 degrees different to landscape rotated to left (difference between ROTATION_0 and ROTATION_180 is less, but still different). This difference is enough to ruin any AR effect. Is it something to do with calibration? (I'm