diff --git a/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java b/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java index f9a1fb0..b566db6 100644 --- a/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java +++ b/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java @@ -48,8 +48,9 @@ public class BRouterView extends View private int centerLon; private int centerLat; - private double scaleLon; - private double scaleLat; + private double scaleLon; // ilon -> pixel + private double scaleLat; // ilat -> pixel + private double scaleMeter2Pixel; private List wpList; private List nogoList; private List nogoVetoList; @@ -517,9 +518,9 @@ public class BRouterView extends View scaleLon = imgw / ( difflon * 1.5 ); scaleLat = imgh / ( difflat * 1.5 ); - double scaleMin = scaleLon < scaleLat ? scaleLon : scaleLat; - scaleLat *= dlon2m; - scaleLon *= dlat2m; + scaleMeter2Pixel = scaleLon < scaleLat ? scaleLon : scaleLat; + scaleLon = scaleMeter2Pixel*dlon2m; + scaleLat = scaleMeter2Pixel*dlat2m; startTime = System.currentTimeMillis(); RoutingContext.prepareNogoPoints( nogoList ); @@ -636,8 +637,7 @@ public class BRouterView extends View int x = imgw / 2 + (int) ( scaleLon * lon ); int y = imgh / 2 - (int) ( scaleLat * lat ); - double[] lonlat2m = CheapRulerSingleton.getLonLatToMeterScales( centerLat ); - int ir = (int) ( n.radius * scaleLat / lonlat2m[1]); + int ir = (int) ( n.radius * scaleMeter2Pixel ); if ( ir > minradius ) { Paint paint = new Paint(); @@ -662,8 +662,7 @@ public class BRouterView extends View private void paintPolygon( Canvas canvas, OsmNogoPolygon p, int minradius ) { - double[] lonlat2m = CheapRulerSingleton.getLonLatToMeterScales( centerLat ); - final int ir = (int) ( p.radius * scaleLat / lonlat2m[1] ); + final int ir = (int) ( p.radius * scaleMeter2Pixel ); if ( ir > minradius ) { Paint paint = new Paint();