fix small issues
git-svn-id: https://osmand.googlecode.com/svn/trunk@190 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
parent
571f93a573
commit
643d3230e9
9 changed files with 47 additions and 50 deletions
|
@ -21,23 +21,24 @@ public class ToDoConstants {
|
||||||
// DONE : back end (POI filter object, save, delete, read)
|
// 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
|
// 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
|
// 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,
|
// 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.
|
// you can always use the same name for different locations.
|
||||||
// 51. Implement console application that prepare indexes to upload on server...
|
// 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?
|
// 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,...]
|
// 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], ...
|
// 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.
|
// 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
|
// 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).
|
// (would you like to use internet for that operation - if using internet is not checked).
|
||||||
|
@ -59,13 +60,7 @@ public class ToDoConstants {
|
||||||
// BUGS Swing
|
// BUGS Swing
|
||||||
|
|
||||||
// DONE ANDROID :
|
// 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
|
// DONE SWING
|
||||||
|
|
|
@ -248,4 +248,16 @@ public class GoogleCodeUploadIndex {
|
||||||
this.labels = labels;
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -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_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
|
poi_filter_food_shop = \u041F\u0440\u043E\u0434\u0443\u043A\u0442\u043E\u0432\u044B\u0435 \u043C\u0430\u0433\u0430\u0437\u0438\u043D\u044B
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
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>
|
<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">
|
<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>
|
<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>
|
<ListPreference android:title="@string/map_tile_source" android:summary="@string/map_tile_source_descr" android:key="map_tile_sources"></ListPreference>
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class MapActivity extends Activity implements LocationListener, IMapLocat
|
||||||
private OsmBugsLayer osmBugsLayer;
|
private OsmBugsLayer osmBugsLayer;
|
||||||
private SavingTrackHelper savingTrackHelper;
|
private SavingTrackHelper savingTrackHelper;
|
||||||
private RoutingHelper routingHelper;
|
private RoutingHelper routingHelper;
|
||||||
private boolean calculateRouteOnGps = true;
|
private boolean calculateRouteOnGps = false;
|
||||||
private RouteLayer routeLayer;
|
private RouteLayer routeLayer;
|
||||||
|
|
||||||
private WakeLock wakeLock;
|
private WakeLock wakeLock;
|
||||||
|
@ -162,13 +162,8 @@ public class MapActivity extends Activity implements LocationListener, IMapLocat
|
||||||
locationLayer.setAppMode(OsmandSettings.getApplicationMode(this));
|
locationLayer.setAppMode(OsmandSettings.getApplicationMode(this));
|
||||||
|
|
||||||
LatLon pointToNavigate = OsmandSettings.getPointToNavigate(this);
|
LatLon pointToNavigate = OsmandSettings.getPointToNavigate(this);
|
||||||
if(OsmandSettings.isUsingInternetToCalculateRoute(this)){
|
routingHelper.setAppMode(OsmandSettings.getApplicationMode(this));
|
||||||
routingHelper.setAppMode(OsmandSettings.getApplicationMode(this));
|
routingHelper.setFinalAndCurrentLocation(pointToNavigate, null);
|
||||||
calculateRouteOnGps = true;
|
|
||||||
routingHelper.setFinalLocation(pointToNavigate);
|
|
||||||
} else {
|
|
||||||
routingHelper.setFinalLocation(null);
|
|
||||||
}
|
|
||||||
navigationLayer.setPointToNavigate(pointToNavigate);
|
navigationLayer.setPointToNavigate(pointToNavigate);
|
||||||
|
|
||||||
SharedPreferences prefs = getSharedPreferences(OsmandSettings.SHARED_PREFERENCES_NAME, MODE_WORLD_READABLE);
|
SharedPreferences prefs = getSharedPreferences(OsmandSettings.SHARED_PREFERENCES_NAME, MODE_WORLD_READABLE);
|
||||||
|
@ -396,11 +391,9 @@ public class MapActivity extends Activity implements LocationListener, IMapLocat
|
||||||
} else {
|
} else {
|
||||||
OsmandSettings.clearPointToNavigate(this);
|
OsmandSettings.clearPointToNavigate(this);
|
||||||
}
|
}
|
||||||
if(OsmandSettings.isUsingInternetToCalculateRoute(this)){
|
routingHelper.setFinalAndCurrentLocation(point, null);
|
||||||
calculateRouteOnGps = true;
|
if(point == null){
|
||||||
routingHelper.setFinalLocation(point);
|
calculateRouteOnGps = false;
|
||||||
} else {
|
|
||||||
routingHelper.setFinalLocation(null);
|
|
||||||
}
|
}
|
||||||
navigationLayer.setPointToNavigate(point);
|
navigationLayer.setPointToNavigate(point);
|
||||||
updateNavigateToPointMenu();
|
updateNavigateToPointMenu();
|
||||||
|
@ -655,7 +648,6 @@ public class MapActivity extends Activity implements LocationListener, IMapLocat
|
||||||
builder.setPositiveButton(R.string.follow, new DialogInterface.OnClickListener(){
|
builder.setPositiveButton(R.string.follow, new DialogInterface.OnClickListener(){
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
routingHelper.setFinalLocation(navigationLayer.getPointToNavigate());
|
|
||||||
Location map = new Location("map"); //$NON-NLS-1$
|
Location map = new Location("map"); //$NON-NLS-1$
|
||||||
map.setLatitude(lat);
|
map.setLatitude(lat);
|
||||||
map.setLongitude(lon);
|
map.setLongitude(lon);
|
||||||
|
|
|
@ -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.finalLocation = finalLocation;
|
||||||
|
this.routeNodes.clear();
|
||||||
|
listDistance = null;
|
||||||
evalWaitInterval = 3000;
|
evalWaitInterval = 3000;
|
||||||
// to update route
|
// to update route
|
||||||
setCurrentLocation(currentLocation);
|
setCurrentLocation(currentLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFinalLocation(LatLon finalLocation){
|
public void setFinalLocation(LatLon finalLocation){
|
||||||
setFinalAndCurrentLocation(finalLocation, getLastFixedLocation());
|
setFinalAndCurrentLocation(finalLocation, getCurrentLocation());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAppMode(ApplicationMode mode){
|
public void setAppMode(ApplicationMode mode){
|
||||||
|
@ -113,7 +115,7 @@ public class RoutingHelper {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Location getLastFixedLocation() {
|
public Location getCurrentLocation() {
|
||||||
return lastFixedLocation;
|
return lastFixedLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,6 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
|
||||||
private ListPreference applicationMode;
|
private ListPreference applicationMode;
|
||||||
private CheckBoxPreference autoZoom;
|
private CheckBoxPreference autoZoom;
|
||||||
private EditTextPreference userPassword;
|
private EditTextPreference userPassword;
|
||||||
private CheckBoxPreference useInternetToCalculateRoute;
|
|
||||||
private Preference reloadIndexes;
|
private Preference reloadIndexes;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -55,8 +54,6 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
|
||||||
applicationMode =(ListPreference) screen.findPreference(OsmandSettings.APPLICATION_MODE);
|
applicationMode =(ListPreference) screen.findPreference(OsmandSettings.APPLICATION_MODE);
|
||||||
applicationMode.setOnPreferenceChangeListener(this);
|
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 = (CheckBoxPreference) screen.findPreference(OsmandSettings.USE_INTERNET_TO_DOWNLOAD_TILES);
|
||||||
useInternetToDownloadTiles.setOnPreferenceChangeListener(this);
|
useInternetToDownloadTiles.setOnPreferenceChangeListener(this);
|
||||||
showPoiOnMap =(CheckBoxPreference) screen.findPreference(OsmandSettings.SHOW_POI_OVER_MAP);
|
showPoiOnMap =(CheckBoxPreference) screen.findPreference(OsmandSettings.SHOW_POI_OVER_MAP);
|
||||||
|
@ -102,7 +99,6 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateAllSettings(){
|
public void updateAllSettings(){
|
||||||
useInternetToCalculateRoute.setChecked(OsmandSettings.isUsingInternetToCalculateRoute(this));
|
|
||||||
useInternetToDownloadTiles.setChecked(OsmandSettings.isUsingInternetToDownloadTiles(this));
|
useInternetToDownloadTiles.setChecked(OsmandSettings.isUsingInternetToDownloadTiles(this));
|
||||||
showPoiOnMap.setChecked(OsmandSettings.isShowingPoiOverMap(this));
|
showPoiOnMap.setChecked(OsmandSettings.isShowingPoiOverMap(this));
|
||||||
rotateMapToBearing.setChecked(OsmandSettings.isRotateMapToBearing(this));
|
rotateMapToBearing.setChecked(OsmandSettings.isRotateMapToBearing(this));
|
||||||
|
@ -176,9 +172,6 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
|
||||||
} else if(preference == showPoiOnMap){
|
} else if(preference == showPoiOnMap){
|
||||||
edit.putBoolean(OsmandSettings.SHOW_POI_OVER_MAP, (Boolean) newValue);
|
edit.putBoolean(OsmandSettings.SHOW_POI_OVER_MAP, (Boolean) newValue);
|
||||||
edit.commit();
|
edit.commit();
|
||||||
} else if(preference == useInternetToCalculateRoute){
|
|
||||||
edit.putBoolean(OsmandSettings.USE_INTERNET_TO_CALCULATE_ROUTE, (Boolean) newValue);
|
|
||||||
edit.commit();
|
|
||||||
} else if(preference == useInternetToDownloadTiles){
|
} else if(preference == useInternetToDownloadTiles){
|
||||||
edit.putBoolean(OsmandSettings.USE_INTERNET_TO_DOWNLOAD_TILES, (Boolean) newValue);
|
edit.putBoolean(OsmandSettings.USE_INTERNET_TO_DOWNLOAD_TILES, (Boolean) newValue);
|
||||||
edit.commit();
|
edit.commit();
|
||||||
|
|
|
@ -62,8 +62,12 @@ public class RouteLayer implements OsmandMapLayer {
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
int w = view.getWidth();
|
int w = view.getWidth();
|
||||||
int h = view.getHeight();
|
int h = view.getHeight();
|
||||||
boundsRect = new Rect(-w / 2, -h, 3 * w / 2, h);
|
if(helper.getCurrentLocation() != null &&
|
||||||
// boundsRect = new Rect(0, 0, w, h);
|
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(),
|
view.calculateTileRectangle(boundsRect, view.getCenterPointX(), view.getCenterPointY(), view.getXTile(), view.getYTile(),
|
||||||
tileRect);
|
tileRect);
|
||||||
double topLatitude = MapUtils.getLatitudeFromTile(view.getZoom(), tileRect.top);
|
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 bottomLatitude = MapUtils.getLatitudeFromTile(view.getZoom(), tileRect.bottom);
|
||||||
double rightLongitude = MapUtils.getLongitudeFromTile(view.getZoom(), tileRect.right);
|
double rightLongitude = MapUtils.getLongitudeFromTile(view.getZoom(), tileRect.right);
|
||||||
helper.fillLocationsToShow(topLatitude, leftLongitude, bottomLatitude, rightLongitude, points);
|
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$
|
Log.e(LogUtil.TAG, "Calculate route layer " + (System.currentTimeMillis() - time)); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue