fix small issues

git-svn-id: https://osmand.googlecode.com/svn/trunk@190 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
Victor Shcherb 2010-06-21 11:44:59 +00:00
parent 571f93a573
commit 643d3230e9
9 changed files with 47 additions and 50 deletions

View file

@ -21,23 +21,24 @@ public class ToDoConstants {
// DONE : back end (POI filter object, save, delete, read)
// TODO : activity to create/edit new index, activity to read both user defined/osm standard, add actions to remove/create
// 33. Build transport locations. Create transport index (transport-stops) (investigate)
// GOT : Victor
// DONE: Load transport routes in swing.
// TODO: Create transport index, create transport activity
// FUTURE RELEASES
// 33. Build transport locations. Create transport index (transport-stops) (investigate)
// DONE: Load transport routes in swing.
// IDEA TO HAVE :
// 48. Enable change favorite point : (for example fav - "car") means last point you left car. It is not static point,
// you can always use the same name for different locations.
// 51. Implement console application that prepare indexes to upload on server...
// 0) run in background 1) download from internet 2) generates indices for Europe (take care about memory) 3) upload?
// 50. Invent opening hours editor in order to edit POI hours better on device
// 52. Make good distribution of POI on map (when POI a lot they are coupling in one place on the south)
// 43. Enable poi filter by name
// 46. Implement downloading strategy for tiles : select max zoom to download [16,15,14,...]
// That means you can save internet because from [16 -> zoom -> 18], [14 -> zoom -> 16 - suitable for speed > 40], ...
// 50. Invent opening hours editor in order to edit POI hours better on device
// 52. Make good distribution of POI on map (when POI a lot they are coupling in one place on the south)
// 53. Add progress bars (for search adresses activity - show that something is loaded in background),
// to internet communication activities [editing/commiting/deleting poi], do not hide edit poi dialog if operation failed
// [move close buttons from alertdialog to own view]
// 43. Enable poi filter by name
// 45. Get clear <Use internet> settings. Move that setting on top settings screen.
// That setting should rule all activities that use internet. It should ask whenever internet is used
// (would you like to use internet for that operation - if using internet is not checked).
@ -59,13 +60,7 @@ public class ToDoConstants {
// BUGS Swing
// DONE ANDROID :
// 49. Calculate route from specified point (not from your location only)
// 37. Get rid of exit button (!). Think about when notification should go & how clear resources if it is necessary
// DONE : add to app settings preference (Refresh indexes).
// 31. Translation.
// 34. Suppport navigation for calculated route (example of get route from internet is in swing app).
// DONE : MiniMap done, Routing settings done, RouteLayer done, RoutingHelper done.
// 44. Show gps status (possibly open existing gps-compass app (free) or suggest to install it - no sense to write own activity)
// DONE SWING

View file

@ -248,4 +248,16 @@ public class GoogleCodeUploadIndex {
this.labels = labels;
}
public static void main(String[] args) throws IOException {
GoogleCodeUploadIndex uploadIndex = new GoogleCodeUploadIndex();
uploadIndex.setLabels("");
uploadIndex.setProjectName("osmand");
// uploadIndex.setFileName(_);
// uploadIndex.setTargetFileName(_);
// uploadIndex.setUserName(_);
// uploadIndex.setSummary(_);
// uploadIndex.setPassword(_);
uploadIndex.upload();
}
}

View file

@ -23,9 +23,9 @@ amenity_type_tourism = Tourism
amenity_type_transportation = Transportation
indexing_address = Indexing address
indexing_address = Indexing address
indexing_poi = Indexing POI
indexing_poi = Indexing POI
km = km

View file

@ -23,9 +23,9 @@ amenity_type_tourism = \u0422\u0443\u0440\u0438\u0437\u043C
amenity_type_transportation = \u0422\u0440\u0430\u043D\u0441\u043F\u043E\u0440\u0442
indexing_address = \u0418\u043D\u0434\u0435\u043A\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044F \u0430\u0434\u0440\u0435\u0441
indexing_address = \u0418\u043D\u0434\u0435\u043A\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044F \u0430\u0434\u0440\u0435\u0441
indexing_poi = \u0418\u043D\u0434\u0435\u043A\u0441\u0438\u0440\u0443\u044E\u0442\u0441\u044F POI
indexing_poi = \u0418\u043D\u0434\u0435\u043A\u0441\u0438\u0440\u0443\u044E\u0442\u0441\u044F POI
km = \u043A\u043C
@ -37,7 +37,7 @@ poi_filter_car_aid = \u0410\u0432\u0442\u043E\u043F\u043E\u043C\u043E\u0449\u044
poi_filter_closest_poi = \u0411\u043B\u0438\u0436\u0430\u0439\u0448\u0438\u0435 poi
poi_filter_custom_filter = \u0414\u0440\u0443\u0433\u043E\u0439 \u0444\u0438\u043B\u044C\u0442\u0440
poi_filter_custom_filter = \u041D\u043E\u0432\u044B\u0439 \u0444\u0438\u043B\u044C\u0442\u0440
poi_filter_food_shop = \u041F\u0440\u043E\u0434\u0443\u043A\u0442\u043E\u0432\u044B\u0435 \u043C\u0430\u0433\u0430\u0437\u0438\u043D\u044B

View file

@ -3,8 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android">
<ListPreference android:summary="@string/settings_preset_descr" android:title="@string/settings_preset" android:key="application_mode"></ListPreference>
<CheckBoxPreference android:key="use_internet_to_calculate_route" android:title="@string/use_online_routing" android:summary="@string/use_online_routing_descr"></CheckBoxPreference>
<!-- <CheckBoxPreference android:key="use_internet_to_calculate_route" android:title="@string/use_online_routing" android:summary="@string/use_online_routing_descr"></CheckBoxPreference> -->
<PreferenceScreen android:title="@string/map_preferences" android:summary="@string/map_preferences_descr">
<CheckBoxPreference android:key="use_internet_to_download_tiles" android:title="@string/use_internet" android:summary="@string/use_internet_to_download_tile"></CheckBoxPreference>
<ListPreference android:title="@string/map_tile_source" android:summary="@string/map_tile_source_descr" android:key="map_tile_sources"></ListPreference>

View file

@ -88,7 +88,7 @@ public class MapActivity extends Activity implements LocationListener, IMapLocat
private OsmBugsLayer osmBugsLayer;
private SavingTrackHelper savingTrackHelper;
private RoutingHelper routingHelper;
private boolean calculateRouteOnGps = true;
private boolean calculateRouteOnGps = false;
private RouteLayer routeLayer;
private WakeLock wakeLock;
@ -162,13 +162,8 @@ public class MapActivity extends Activity implements LocationListener, IMapLocat
locationLayer.setAppMode(OsmandSettings.getApplicationMode(this));
LatLon pointToNavigate = OsmandSettings.getPointToNavigate(this);
if(OsmandSettings.isUsingInternetToCalculateRoute(this)){
routingHelper.setAppMode(OsmandSettings.getApplicationMode(this));
calculateRouteOnGps = true;
routingHelper.setFinalLocation(pointToNavigate);
} else {
routingHelper.setFinalLocation(null);
}
routingHelper.setAppMode(OsmandSettings.getApplicationMode(this));
routingHelper.setFinalAndCurrentLocation(pointToNavigate, null);
navigationLayer.setPointToNavigate(pointToNavigate);
SharedPreferences prefs = getSharedPreferences(OsmandSettings.SHARED_PREFERENCES_NAME, MODE_WORLD_READABLE);
@ -396,11 +391,9 @@ public class MapActivity extends Activity implements LocationListener, IMapLocat
} else {
OsmandSettings.clearPointToNavigate(this);
}
if(OsmandSettings.isUsingInternetToCalculateRoute(this)){
calculateRouteOnGps = true;
routingHelper.setFinalLocation(point);
} else {
routingHelper.setFinalLocation(null);
routingHelper.setFinalAndCurrentLocation(point, null);
if(point == null){
calculateRouteOnGps = false;
}
navigationLayer.setPointToNavigate(point);
updateNavigateToPointMenu();
@ -655,7 +648,6 @@ public class MapActivity extends Activity implements LocationListener, IMapLocat
builder.setPositiveButton(R.string.follow, new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog, int which) {
routingHelper.setFinalLocation(navigationLayer.getPointToNavigate());
Location map = new Location("map"); //$NON-NLS-1$
map.setLatitude(lat);
map.setLongitude(lon);

View file

@ -69,15 +69,17 @@ public class RoutingHelper {
}
public void setFinalAndCurrentLocation(LatLon finalLocation, Location currentLocation){
public synchronized void setFinalAndCurrentLocation(LatLon finalLocation, Location currentLocation){
this.finalLocation = finalLocation;
this.routeNodes.clear();
listDistance = null;
evalWaitInterval = 3000;
// to update route
setCurrentLocation(currentLocation);
}
public void setFinalLocation(LatLon finalLocation){
setFinalAndCurrentLocation(finalLocation, getLastFixedLocation());
setFinalAndCurrentLocation(finalLocation, getCurrentLocation());
}
public void setAppMode(ApplicationMode mode){
@ -113,7 +115,7 @@ public class RoutingHelper {
return false;
}
public Location getLastFixedLocation() {
public Location getCurrentLocation() {
return lastFixedLocation;
}

View file

@ -43,7 +43,6 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
private ListPreference applicationMode;
private CheckBoxPreference autoZoom;
private EditTextPreference userPassword;
private CheckBoxPreference useInternetToCalculateRoute;
private Preference reloadIndexes;
@Override
@ -55,8 +54,6 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
applicationMode =(ListPreference) screen.findPreference(OsmandSettings.APPLICATION_MODE);
applicationMode.setOnPreferenceChangeListener(this);
useInternetToCalculateRoute = (CheckBoxPreference) screen.findPreference(OsmandSettings.USE_INTERNET_TO_CALCULATE_ROUTE);
useInternetToCalculateRoute.setOnPreferenceChangeListener(this);
useInternetToDownloadTiles = (CheckBoxPreference) screen.findPreference(OsmandSettings.USE_INTERNET_TO_DOWNLOAD_TILES);
useInternetToDownloadTiles.setOnPreferenceChangeListener(this);
showPoiOnMap =(CheckBoxPreference) screen.findPreference(OsmandSettings.SHOW_POI_OVER_MAP);
@ -102,7 +99,6 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
}
public void updateAllSettings(){
useInternetToCalculateRoute.setChecked(OsmandSettings.isUsingInternetToCalculateRoute(this));
useInternetToDownloadTiles.setChecked(OsmandSettings.isUsingInternetToDownloadTiles(this));
showPoiOnMap.setChecked(OsmandSettings.isShowingPoiOverMap(this));
rotateMapToBearing.setChecked(OsmandSettings.isRotateMapToBearing(this));
@ -176,9 +172,6 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
} else if(preference == showPoiOnMap){
edit.putBoolean(OsmandSettings.SHOW_POI_OVER_MAP, (Boolean) newValue);
edit.commit();
} else if(preference == useInternetToCalculateRoute){
edit.putBoolean(OsmandSettings.USE_INTERNET_TO_CALCULATE_ROUTE, (Boolean) newValue);
edit.commit();
} else if(preference == useInternetToDownloadTiles){
edit.putBoolean(OsmandSettings.USE_INTERNET_TO_DOWNLOAD_TILES, (Boolean) newValue);
edit.commit();

View file

@ -62,8 +62,12 @@ public class RouteLayer implements OsmandMapLayer {
long time = System.currentTimeMillis();
int w = view.getWidth();
int h = view.getHeight();
boundsRect = new Rect(-w / 2, -h, 3 * w / 2, h);
// boundsRect = new Rect(0, 0, w, h);
if(helper.getCurrentLocation() != null &&
view.isPointOnTheRotatedMap(helper.getCurrentLocation().getLatitude(), helper.getCurrentLocation().getLongitude())){
boundsRect = new Rect(-w / 2, -h, 3 * w / 2, h);
} else {
boundsRect = new Rect(0, -h, w, h);
}
view.calculateTileRectangle(boundsRect, view.getCenterPointX(), view.getCenterPointY(), view.getXTile(), view.getYTile(),
tileRect);
double topLatitude = MapUtils.getLatitudeFromTile(view.getZoom(), tileRect.top);
@ -71,7 +75,7 @@ public class RouteLayer implements OsmandMapLayer {
double bottomLatitude = MapUtils.getLatitudeFromTile(view.getZoom(), tileRect.bottom);
double rightLongitude = MapUtils.getLongitudeFromTile(view.getZoom(), tileRect.right);
helper.fillLocationsToShow(topLatitude, leftLongitude, bottomLatitude, rightLongitude, points);
if((System.currentTimeMillis() - time) > 40){
if((System.currentTimeMillis() - time) > 80){
Log.e(LogUtil.TAG, "Calculate route layer " + (System.currentTimeMillis() - time)); //$NON-NLS-1$
}