From ed9b883c15131530d3dc490cc1ea7771dd504072 Mon Sep 17 00:00:00 2001 From: Denis Date: Mon, 29 Dec 2014 12:55:39 +0200 Subject: [PATCH 1/2] Fixed directon drawable for poi --- OsmAnd/src/net/osmand/plus/views/DirectionDrawable.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/DirectionDrawable.java b/OsmAnd/src/net/osmand/plus/views/DirectionDrawable.java index 6cfede7e37..9b15634d42 100644 --- a/OsmAnd/src/net/osmand/plus/views/DirectionDrawable.java +++ b/OsmAnd/src/net/osmand/plus/views/DirectionDrawable.java @@ -47,17 +47,15 @@ public class DirectionDrawable extends Drawable { @Override public void draw(Canvas canvas) { - if (favorite) { canvas.rotate(angle, canvas.getHeight()/2, canvas.getWidth()/2); Bitmap arrow = BitmapFactory.decodeResource(ctx.getResources(), R.drawable.ic_destination_arrow); canvas.drawBitmap(arrow, null, new Rect(0,0,arrow.getHeight(), arrow.getWidth()), null); } else { - canvas.rotate(angle, width / 2, height / 2); + canvas.rotate(angle, canvas.getHeight()/2, canvas.getWidth() / 2); Path directionPath = createDirectionPath(); canvas.drawPath(directionPath, paintRouteDirection); } - } @Override From 819a61216ea47baf60a6425e1dfc56a6cdebca36 Mon Sep 17 00:00:00 2001 From: Denis Date: Mon, 29 Dec 2014 12:56:52 +0200 Subject: [PATCH 2/2] Added test for buggy geo intent --- .../src/net/osmand/util/GeoPointParserUtil.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/OsmAnd-java/src/net/osmand/util/GeoPointParserUtil.java b/OsmAnd-java/src/net/osmand/util/GeoPointParserUtil.java index 9f1c6d6b50..16f6e5bf12 100644 --- a/OsmAnd-java/src/net/osmand/util/GeoPointParserUtil.java +++ b/OsmAnd-java/src/net/osmand/util/GeoPointParserUtil.java @@ -95,6 +95,17 @@ public class GeoPointParserUtil { actual = GeoPointParserUtil.parse("geo", url); assertGeoPoint(actual, new GeoParsedPoint(qstr)); + // geo:50.451300,30.569900?z=15&q=50.451300,30.569900 (Kiev) + z = 15; + String qname = "Kiev"; + double qlat = 50.4513; + double qlon = 30.5699; + + url = "geo:50.451300,30.569900?z=15&q=50.451300,30.569900 (Kiev)"; + System.out.println("url: " + url); + actual = GeoPointParserUtil.parse("geo", url); + assertGeoPoint(actual, new GeoParsedPoint(qlat, qlon, z, qname)); + // http://download.osmand.net/go?lat=34&lon=-106&z=11 url = "http://download.osmand.net/go?lat=" + ilat + "&lon=" + ilon + "&z=" + z; System.out.println("url: " + url); @@ -333,7 +344,7 @@ public class GeoPointParserUtil { * * @param scheme * The intent scheme - * @param data + * @param uri * The URI object * @return {@link GeoParsedPoint} */