compass-geolocation

Pointing to a specific location (compass) using an image instead of drawing

自闭症网瘾萝莉.ら 提交于 2019-12-08 14:02:59
问题 I'm using this code like a compass which point using the arrow to a specific location(Using GPS Values). This code is doing great except i want to replace drawing the arrow by an image of the arrow..but i don't know how. any help please?? @Override public void draw(Canvas canvas) { double angle = calculateAngle(currentLongitude, currentLatitude, targetLongitude, targetLatitude); //Correction; angle-=90; //Correction for azimuth angle-=azimuth; if((getContext() instanceof Activity) && (

North calculation based on magnetometer and gyroscope

半世苍凉 提交于 2019-12-08 01:36:33
问题 I need to calculate "facing" (it doesn't matter if it will be based on true north or magnetic one). As it can be seen on the iOS devices the CLHeading objects returned by the CLLocationManager gives us both the true and the magnetic heading by corresponding properties. Also, we can very easily see, that those values are related to the top of the device (the positive Y axis of the devices coordinate system) wich is not good for my purposes. What I actually need is to calculate the facing

Determining north using the android phone

☆樱花仙子☆ 提交于 2019-12-07 07:03:34
问题 I looked over SensorManager and was still unsure, how do I detect if the phone is looking at true north (or any other direction for that matter). 回答1: If you are just looking for a sample, the publishers of Professional Android 2 Application Development have all their example code available for download and there is a compass application in chapter 14. 来源: https://stackoverflow.com/questions/2808811/determining-north-using-the-android-phone

Calculating angle between two vectors?

a 夏天 提交于 2019-12-06 12:41:50
问题 I'm developing an iOS app, which has to show POIs (points of interest) depending on device heading. I used CLLocationManager to get user's location and heading. I have one pair of destination's coordinates. Based on this I'm calculating which quarter is that and returning float value of deviation from south (0 degrees) in degrees. I have -/+180 degrees in the north and 0 in the south. Here is code snippet: -(float)updateTargetLongitude:(float)lon Latitude:(float)lat{ // //longitude = x // /

Determining north using the android phone

主宰稳场 提交于 2019-12-05 17:09:48
I looked over SensorManager and was still unsure, how do I detect if the phone is looking at true north (or any other direction for that matter). If you are just looking for a sample, the publishers of Professional Android 2 Application Development have all their example code available for download and there is a compass application in chapter 14. 来源: https://stackoverflow.com/questions/2808811/determining-north-using-the-android-phone

unity GPS coordinates to (X,Y,Z), rotating north

蓝咒 提交于 2019-12-05 08:05:06
问题 I'm making an app with Unity3D which uses GPS coordinates to place a "thing" in the 3D world, as you walk in real world close to it, you will find it getting close. kinda like PokemonGO So the problem is: I managed to place the object at the right place and distance, using a function dist(lat1,lon1,lat2,lon2) which give me the distance in meters between the 2 coordinates (see below). What i want to do next is to make the scene turn around the Y axis in order to head north (Z axis+ should be

iOS iPhone show user direction and orientation in space like the compass app on MKMapView

非 Y 不嫁゛ 提交于 2019-12-05 00:20:20
问题 When the compass app uses a map view to display it's location, there's a little cone that displays the direction in which the phone is pointing. However, I was unable to reproduce it using MKMapView that shows user's location. Is this cone of sight feature available to developers, or will I have to implement one myself? Thank you! 回答1: I faced a similar situation. I don't think we have library or settings to display the direction on the blue icon (at least my search was not successful).

Calculating angle between two vectors?

旧时模样 提交于 2019-12-04 19:25:11
I'm developing an iOS app, which has to show POIs (points of interest) depending on device heading. I used CLLocationManager to get user's location and heading. I have one pair of destination's coordinates. Based on this I'm calculating which quarter is that and returning float value of deviation from south (0 degrees) in degrees. I have -/+180 degrees in the north and 0 in the south. Here is code snippet: -(float)updateTargetLongitude:(float)lon Latitude:(float)lat{ // //longitude = x // //latitude = y NSLog(@"current location = (%.5f, %.5f)", [[NSUserDefaults standardUserDefaults]

How to show direction on map based on calculated angle in degrees

扶醉桌前 提交于 2019-12-04 18:01:19
I have calculated angle between two Latitude and Longitude coordinates as below code.It returns angle as 3 in radians, and 193 in degrees. I want to show arrow marker on map based on this angle.How to display object direction moved,based on this angle? public static double getAngle(double lat1, double lon1, double lat2, double lon2) { //Formulas //θ = atan2( sin(Δlong).cos(lat2),cos(lat1).sin(lat2) − sin(lat1).cos(lat2).cos(Δlong) ) // Δlong = long2 - long1 Log.i("angle", "Inside getAngle"); double latitude1 = Math.toRadians(lat1); double longitude1 = Math.toRadians(lon1); double latitude2 =

Finding Direction in iPhone like in Compass?

时间秒杀一切 提交于 2019-12-04 17:44:27
问题 Do any one have idea for finding true direction using iPhone? I want to implement such application in which I need to find direction in which iPhone is pointing and want to make application same as compass application in iphone 3GS. Does iPhone 3G supports compass functionality? And can any one tell me how compass application find directions so accurately like a real magnetic compass? Please help me for this. I am in a critical situation. Thanks in advance. 回答1: here is a sample code link