diff --git a/OsmAnd-api/src/net/osmand/aidlapi/IOsmAndAidlInterface.aidl b/OsmAnd-api/src/net/osmand/aidlapi/IOsmAndAidlInterface.aidl index 92115f873b..0b0466ff21 100644 --- a/OsmAnd-api/src/net/osmand/aidlapi/IOsmAndAidlInterface.aidl +++ b/OsmAnd-api/src/net/osmand/aidlapi/IOsmAndAidlInterface.aidl @@ -2,6 +2,7 @@ package net.osmand.aidlapi; import net.osmand.aidlapi.map.ALatLon; import net.osmand.aidlapi.map.SetMapLocationParams; +import net.osmand.aidlapi.map.SetLocationParams; import net.osmand.aidlapi.favorite.group.AFavoriteGroup; import net.osmand.aidlapi.favorite.group.AddFavoriteGroupParams; @@ -901,4 +902,6 @@ interface IOsmAndAidlInterface { boolean addRoadBlock(in AddBlockedRoadParams params); boolean removeRoadBlock(in RemoveBlockedRoadParams params); + + boolean setLocation(in SetLocationParams params); } \ No newline at end of file diff --git a/OsmAnd-api/src/net/osmand/aidlapi/map/ALocation.aidl b/OsmAnd-api/src/net/osmand/aidlapi/map/ALocation.aidl new file mode 100644 index 0000000000..88c65b5e0c --- /dev/null +++ b/OsmAnd-api/src/net/osmand/aidlapi/map/ALocation.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidlapi.map; + +parcelable ALocation; \ No newline at end of file diff --git a/OsmAnd-api/src/net/osmand/aidlapi/map/ALocation.java b/OsmAnd-api/src/net/osmand/aidlapi/map/ALocation.java new file mode 100644 index 0000000000..03741138d5 --- /dev/null +++ b/OsmAnd-api/src/net/osmand/aidlapi/map/ALocation.java @@ -0,0 +1,208 @@ +package net.osmand.aidlapi.map; + +import android.os.Bundle; +import android.os.Parcel; +import android.os.Parcelable; + +import net.osmand.aidlapi.AidlParams; + +public class ALocation extends AidlParams { + + private double latitude = 0.0; + private double longitude = 0.0; + private long time = 0; + private boolean hasAltitude = false; + private double altitude = 0.0f; + private boolean hasSpeed = false; + private float speed = 0.0f; + private boolean hasBearing = false; + private float bearing = 0.0f; + private boolean hasAccuracy = false; + private float accuracy = 0.0f; + private boolean hasVerticalAccuracy = false; + private float verticalAccuracy = 0.0f; + + private ALocation() { + } + + public ALocation(Parcel in) { + readFromParcel(in); + } + + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + @Override + public ALocation createFromParcel(Parcel in) { + return new ALocation(in); + } + + @Override + public ALocation[] newArray(int size) { + return new ALocation[size]; + } + }; + + public double getLatitude() { + return latitude; + } + + public double getLongitude() { + return longitude; + } + + public long getTime() { + return time; + } + + public boolean hasAltitude() { + return hasAltitude; + } + + public double getAltitude() { + return altitude; + } + + public boolean hasSpeed() { + return hasSpeed; + } + + public float getSpeed() { + return speed; + } + + public boolean hasBearing() { + return hasBearing; + } + + public float getBearing() { + return bearing; + } + + public boolean hasAccuracy() { + return hasAccuracy; + } + + public float getAccuracy() { + return accuracy; + } + + public boolean hasVerticalAccuracy() { + return hasVerticalAccuracy; + } + + public float getVerticalAccuracy() { + return verticalAccuracy; + } + + @Override + protected void writeToBundle(Bundle bundle) { + bundle.putDouble("latitude", latitude); + bundle.putDouble("longitude", longitude); + bundle.putLong("time", time); + bundle.putBoolean("hasAltitude", hasAltitude); + bundle.putDouble("altitude", altitude); + bundle.putBoolean("hasSpeed", hasSpeed); + bundle.putFloat("speed", speed); + bundle.putBoolean("hasBearing", hasBearing); + bundle.putFloat("bearing", bearing); + bundle.putBoolean("hasAccuracy", hasAccuracy); + bundle.putFloat("accuracy", accuracy); + bundle.putBoolean("hasVerticalAccuracy", hasVerticalAccuracy); + bundle.putFloat("verticalAccuracy", verticalAccuracy); + } + + @Override + protected void readFromBundle(Bundle bundle) { + latitude = bundle.getDouble("latitude"); + longitude = bundle.getDouble("longitude"); + time = bundle.getLong("time"); + hasAltitude = bundle.getBoolean("hasAltitude"); + altitude = bundle.getDouble("altitude"); + hasSpeed = bundle.getBoolean("hasSpeed"); + speed = bundle.getFloat("speed"); + hasBearing = bundle.getBoolean("hasBearing"); + bearing = bundle.getFloat("bearing"); + hasAccuracy = bundle.getBoolean("hasAccuracy"); + accuracy = bundle.getFloat("accuracy"); + hasVerticalAccuracy = bundle.getBoolean("hasVerticalAccuracy"); + verticalAccuracy = bundle.getFloat("verticalAccuracy"); + } + + public static Builder builder() { + return new ALocation().new Builder(); + } + + public class Builder { + + private Builder() { + } + + public Builder setLatitude(double latitude) { + ALocation.this.latitude = latitude; + return this; + } + + public Builder setLongitude(double longitude) { + ALocation.this.longitude = longitude; + return this; + } + + public Builder setTime(long time) { + ALocation.this.time = time; + return this; + } + + public Builder hasAltitude(boolean hasAltitude) { + ALocation.this.hasAltitude = hasAltitude; + return this; + } + + public Builder setAltitude(float altitude) { + ALocation.this.altitude = altitude; + return this; + } + + public Builder hasSpeed(boolean hasSpeed) { + ALocation.this.hasSpeed = hasSpeed; + return this; + } + + public Builder setSpeed(float speed) { + ALocation.this.speed = speed; + return this; + } + + public Builder hasBearing(boolean hasBearing) { + ALocation.this.hasBearing = hasBearing; + return this; + } + + public Builder setBearing(float bearing) { + ALocation.this.bearing = bearing; + return this; + } + + public Builder hasAccuracy(boolean hasAccuracy) { + ALocation.this.hasAccuracy = hasAccuracy; + return this; + } + + public Builder setAccuracy(float accuracy) { + ALocation.this.accuracy = accuracy; + return this; + } + + public Builder hasVerticalAccuracy(boolean hasVerticalAccuracy) { + ALocation.this.hasVerticalAccuracy = hasVerticalAccuracy; + return this; + } + + public Builder setVerticalAccuracy(float verticalAccuracy) { + ALocation.this.verticalAccuracy = verticalAccuracy; + return this; + } + + public ALocation build() { + return ALocation.this; + } + } +} diff --git a/OsmAnd-api/src/net/osmand/aidlapi/map/SetLocationParams.aidl b/OsmAnd-api/src/net/osmand/aidlapi/map/SetLocationParams.aidl new file mode 100644 index 0000000000..e39726efd0 --- /dev/null +++ b/OsmAnd-api/src/net/osmand/aidlapi/map/SetLocationParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidlapi.map; + +parcelable SetLocationParams; \ No newline at end of file diff --git a/OsmAnd-api/src/net/osmand/aidlapi/map/SetLocationParams.java b/OsmAnd-api/src/net/osmand/aidlapi/map/SetLocationParams.java new file mode 100644 index 0000000000..ddbe492a3f --- /dev/null +++ b/OsmAnd-api/src/net/osmand/aidlapi/map/SetLocationParams.java @@ -0,0 +1,54 @@ +package net.osmand.aidlapi.map; + +import android.os.Bundle; +import android.os.Parcel; + +import net.osmand.aidlapi.AidlParams; + +public class SetLocationParams extends AidlParams { + + private ALocation location; + private long timeToNotUseOtherGPS; + + public SetLocationParams(ALocation location, long timeToNotUseOtherGPS) { + this.location = location; + this.timeToNotUseOtherGPS = timeToNotUseOtherGPS; + } + + public SetLocationParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public SetLocationParams createFromParcel(Parcel in) { + return new SetLocationParams(in); + } + + @Override + public SetLocationParams[] newArray(int size) { + return new SetLocationParams[size]; + } + }; + + public ALocation getLocation() { + return location; + } + + public long getTimeToNotUseOtherGPS() { + return timeToNotUseOtherGPS; + } + + @Override + public void writeToBundle(Bundle bundle) { + bundle.putParcelable("location", location); + bundle.putLong("timeToNotUseOtherGPS", timeToNotUseOtherGPS); + } + + @Override + protected void readFromBundle(Bundle bundle) { + bundle.setClassLoader(ALocation.class.getClassLoader()); + location = bundle.getParcelable("location"); + timeToNotUseOtherGPS = bundle.getLong("timeToNotUseOtherGPS"); + } +} \ No newline at end of file diff --git a/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java b/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java index 44c48f69ec..6bb4da1ce5 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java @@ -1216,7 +1216,13 @@ public class RouteResultPreparation { TurnType t = TurnType.getExitTurn(exit, 0, leftSide); // usually covers more than expected float turnAngleBasedOnOutRoads = (float) MapUtils.degreesDiff(last.getBearingBegin(), prev.getBearingEnd()); - float turnAngleBasedOnCircle = (float) -MapUtils.degreesDiff(firstRoundabout.getBearingBegin(), lastRoundabout.getBearingEnd() + 180); + // Angle based on circle method tries + // 1. to calculate antinormal to roundabout circle on roundabout entrance and + // 2. normal to roundabout circle on roundabout exit + // 3. calculate angle difference + // This method doesn't work if you go from S to N touching only 1 point of roundabout, + // but it is very important to identify very sharp or very large angle to understand did you pass whole roundabout or small entrance + float turnAngleBasedOnCircle = (float) MapUtils.degreesDiff(firstRoundabout.getBearingBegin(), lastRoundabout.getBearingEnd() + 180); if (Math.abs(turnAngleBasedOnOutRoads) > 120) { // correctly identify if angle is +- 180, so we approach from left or right side t.setTurnAngle(turnAngleBasedOnCircle) ; diff --git a/OsmAnd/res/values-ar/phrases.xml b/OsmAnd/res/values-ar/phrases.xml index 86450cf7d9..2b880e83d6 100644 --- a/OsmAnd/res/values-ar/phrases.xml +++ b/OsmAnd/res/values-ar/phrases.xml @@ -3675,4 +3675,7 @@ اتصال قنصلية سفارة + نفق خفافيش + جسر خفافيش + معبر الحيوانات البرية \ No newline at end of file diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml index ef68e3055c..8929bd6f4d 100644 --- a/OsmAnd/res/values-ar/strings.xml +++ b/OsmAnd/res/values-ar/strings.xml @@ -2826,7 +2826,7 @@ أسلوب الملاحة مع التباين العالي والحد الأعلى من التفاصيل. يتضمن كل خيارات النمط الافتراضي أوسماند، مع عرض أكبر قدر ممكن من التفاصيل ، ولا سيما الطرق والمسارات وطرق السفر الأخرى. التمييز الواضح بين \"جولة الأطلس\" بين أنواع الطرق. مناسبة للاستخدام النهاري والليلي وفي الهواء الطلق. أسلوب الغرض العام. تقديم نظافة مبسطة في المدن المكتظة بالسكان. الملامح الرئيسية: خطوط الكنتور ، والطرق ، وجودة السطح ، والقيود المفروضة على الوصول ، ودروع الطريق ، والمسارات التي تظهر وفقاً لمقياس SAC ، وميزات رياضة الماء الأبيض. قم بتنزيل أدلة السفر هذه من ويكي الرحلات لعرض مقالات حول الأماكن في العالم بدون إنترنت. - دليل السفر حاليا على أساس Wikivoyage. اختبار كافة الميزات أثناء اختبار بيتا المفتوحة مجانا.بعد ذلك، وأدلة السفر ستكون متاحة للمشتركين في أوسماند غير المحدود و اصحاب +أوسماند. + دليل السفر حاليا على أساس Wikivoyage. اختبار كافة الميزات أثناء اختبار بيتا المفتوحة مجانا. ملف GPX مع الإحداثيات والبيانات من الملاحظات المحددة. ملف GPX مع الإحداثيات والبيانات من كافة الملاحظات.