From 2e08962813fded6ffc8c8b24e8e45a667ec2c36a Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 8 Aug 2010 13:00:54 +0000 Subject: [PATCH] BUGFIX git-svn-id: https://osmand.googlecode.com/svn/trunk@444 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8 --- DataExtractionOSM/src/com/osmand/ToDoConstants.java | 1 - .../src/com/osmand/data/index/IndexBatchCreator.java | 4 ++-- OsmAnd/src/com/osmand/activities/MapActivity.java | 8 ++++++-- .../src/com/osmand/activities/ShowRouteInfoActivity.java | 2 +- .../com/osmand/activities/search/SearchPOIActivity.java | 2 ++ OsmAnd/src/com/osmand/views/MapInfoLayer.java | 2 +- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/DataExtractionOSM/src/com/osmand/ToDoConstants.java b/DataExtractionOSM/src/com/osmand/ToDoConstants.java index 091e6f3ea7..62a77b291d 100644 --- a/DataExtractionOSM/src/com/osmand/ToDoConstants.java +++ b/DataExtractionOSM/src/com/osmand/ToDoConstants.java @@ -25,7 +25,6 @@ public class ToDoConstants { // Improvements // ! Download with wget // ! progress while map is loading - // ! Give voice alert before 3km to the turn & take into account speed (to say faster) // Not clear if it is really needed // 69. Add phone information to POI diff --git a/DataExtractionOSM/src/com/osmand/data/index/IndexBatchCreator.java b/DataExtractionOSM/src/com/osmand/data/index/IndexBatchCreator.java index 781a869503..9b5725f18f 100644 --- a/DataExtractionOSM/src/com/osmand/data/index/IndexBatchCreator.java +++ b/DataExtractionOSM/src/com/osmand/data/index/IndexBatchCreator.java @@ -28,7 +28,7 @@ public class IndexBatchCreator { private static final boolean indexPOI = true; private static final boolean indexAddress = true; private static final boolean indexTransport = true; - private static final boolean writeWayNodes = true; + private static final boolean writeWayNodes = false; protected static final Log log = LogUtil.getLog(IndexBatchCreator.class); protected static final String SITE_TO_DOWNLOAD1 = "http://download.geofabrik.de/osm/europe/"; //$NON-NLS-1$ @@ -420,7 +420,7 @@ public class IndexBatchCreator { uploader.setUserName(user); uploader.setPassword(password); uploader.setLabels("Type-Archive, Testdata"); - uploader.setSummary(summary); + uploader.setSummary(summary.replace('_', ' ')); try { uploader.upload(); } catch (IOException e) { diff --git a/OsmAnd/src/com/osmand/activities/MapActivity.java b/OsmAnd/src/com/osmand/activities/MapActivity.java index 1dd2d7eb50..d5bfd6599c 100644 --- a/OsmAnd/src/com/osmand/activities/MapActivity.java +++ b/OsmAnd/src/com/osmand/activities/MapActivity.java @@ -844,10 +844,14 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso val += 90; } if (currentMapRotation == OsmandSettings.ROTATE_MAP_COMPASS && !mapView.mapIsAnimating()) { - mapView.setRotate(-val); + if(Math.abs(mapView.getRotate() + val) > 10){ + mapView.setRotate(-val); + } } if(currentShowingAngle){ - locationLayer.setHeading(val); + if(locationLayer.getHeading() == null || Math.abs(locationLayer.getHeading() - val) > 10){ + locationLayer.setHeading(val); + } } } diff --git a/OsmAnd/src/com/osmand/activities/ShowRouteInfoActivity.java b/OsmAnd/src/com/osmand/activities/ShowRouteInfoActivity.java index 5cff412bd9..dccb48f574 100644 --- a/OsmAnd/src/com/osmand/activities/ShowRouteInfoActivity.java +++ b/OsmAnd/src/com/osmand/activities/ShowRouteInfoActivity.java @@ -67,7 +67,7 @@ public class ShowRouteInfoActivity extends ListActivity { int minutes = (helper.getLeftTime() / 60) % 60; header.setText(MessageFormat.format(getString(R.string.route_general_information), MapUtils.getFormattedDistance(dist), hours, minutes)); - float f = Math.min(dm.widthPixels/dm.densityDpi,dm.heightPixels/dm.densityDpi); + float f = Math.min(dm.widthPixels/(dm.density*160),dm.heightPixels/(dm.density*160)); if (f >= 3) { // large screen header.setTextSize(dm.scaledDensity * 23); diff --git a/OsmAnd/src/com/osmand/activities/search/SearchPOIActivity.java b/OsmAnd/src/com/osmand/activities/search/SearchPOIActivity.java index 9a15a751d7..92f08542f3 100644 --- a/OsmAnd/src/com/osmand/activities/search/SearchPOIActivity.java +++ b/OsmAnd/src/com/osmand/activities/search/SearchPOIActivity.java @@ -385,6 +385,8 @@ public class SearchPOIActivity extends ListActivity implements SensorEventListen location = null; amenityAdapter.notifyDataSetChanged(); searchPOILevel.setEnabled(false); + } else { + setLocation(location); } if(searchNearBy && location == null){ searchPOILevel.setText(R.string.search_poi_location); diff --git a/OsmAnd/src/com/osmand/views/MapInfoLayer.java b/OsmAnd/src/com/osmand/views/MapInfoLayer.java index 8caa017b7d..2c71419f32 100644 --- a/OsmAnd/src/com/osmand/views/MapInfoLayer.java +++ b/OsmAnd/src/com/osmand/views/MapInfoLayer.java @@ -93,7 +93,7 @@ public class MapInfoLayer implements OsmandMapLayer { dm = new DisplayMetrics(); mgr.getDefaultDisplay().getMetrics(dm); scaleCoefficient = dm.density; - if(Math.min(dm.widthPixels/dm.densityDpi, dm.heightPixels/dm.densityDpi) > 2.5f){ + if(Math.min(dm.widthPixels/(dm.density*160), dm.heightPixels/(dm.density*160)) > 2.5f){ // large screen scaleCoefficient *= 1.5f; }