Merge branch 'master' of git@github.com:osmandapp/Osmand.git

This commit is contained in:
sonora 2011-10-15 23:02:47 +02:00
commit 8fefc66302
17 changed files with 258 additions and 129 deletions

View file

@ -3,7 +3,7 @@
<string name="data_to_search_poi_not_available">Brak danych lokalnych do wyszukania POI</string> <string name="data_to_search_poi_not_available">Brak danych lokalnych do wyszukania POI</string>
<string name="poi_filter_by_name">Szukaj wg nazwy</string> <string name="poi_filter_by_name">Szukaj wg nazwy</string>
<string name="old_poi_file_should_be_deleted">Plik \'%1$s\' z danymi POI jest przestarzały i należy go usunąć.</string> <string name="old_poi_file_should_be_deleted">Plik \'%1$s\' z danymi POI jest nadmiarowy i można go usunąć.</string>
<string name="update_poi_file_not_found">Nie znaleziono lokalnego pliku z POI i nie może on zostać utworzony.</string> <string name="update_poi_file_not_found">Nie znaleziono lokalnego pliku z POI i nie może on zostać utworzony.</string>
<string name="update_poi_does_not_change_indexes">Zmiana POI w aplikacji nie powoduje zmian w mapie, a jedynie jest zapisywana w pliku lokalnym.</string> <string name="update_poi_does_not_change_indexes">Zmiana POI w aplikacji nie powoduje zmian w mapie, a jedynie jest zapisywana w pliku lokalnym.</string>
<string name="button_upgrade_osmandplus">Uaktualnij Osmand+</string> <string name="button_upgrade_osmandplus">Uaktualnij Osmand+</string>
@ -15,9 +15,9 @@
<string name="choose_auto_follow_route">Autostart nawigatora</string> <string name="choose_auto_follow_route">Autostart nawigatora</string>
<string name="choose_auto_follow_route_descr">Ustaw czas, po którym nastąpi automatyczne uruchomienie nawigatora</string> <string name="choose_auto_follow_route_descr">Ustaw czas, po którym nastąpi automatyczne uruchomienie nawigatora</string>
<string name="search_select_point">Wybierz</string> <string name="search_select_point">Wybierz</string>
<string name="local_index_description">Pobierz nowe, zarchiwizuj lub usuń istniejące dane. \nIstniejące dane offline na urządzeniu (%1$s jest dostępny):</string> <string name="local_index_description">Pobierz nowe, zarchiwizuj lub usuń istniejące dane. \nIstniejące dane offline na urządzeniu (%1$s jest dostępne):</string>
<string name="search_position_current_location_search">Ustal pozycję GPS...</string> <string name="search_position_current_location_search">Ustal pozycję GPS...</string>
<string name="search_position_current_location_found">Pozycja [Ustalono]</string> <string name="search_position_current_location_found">Pozycja [ustalona]</string>
<string name="search_position_address">Adres...</string> <string name="search_position_address">Adres...</string>
<string name="search_position_favorites">Ulubione...</string> <string name="search_position_favorites">Ulubione...</string>
<string name="search_position_undefined">Niezdefiniowane</string> <string name="search_position_undefined">Niezdefiniowane</string>
@ -181,8 +181,8 @@
\n\tNastępnie wybierz sposób udostępnienia. Do wyboru jest e-mail, SMS lub zwykłe skopiowanie koordynat do schowka.</string> \n\tNastępnie wybierz sposób udostępnienia. Do wyboru jest e-mail, SMS lub zwykłe skopiowanie koordynat do schowka.</string>
<string name="tip_favorites">Ulubione punkty</string> <string name="tip_favorites">Ulubione punkty</string>
<string name="tip_favorites_t">\tCzęsto używane punkty mogą zostać zapisane jako Ulubione. <string name="tip_favorites_t">\tCzęsto używane punkty mogą zostać zapisane jako ulubione.
\n\tAby zapisać punkt jako Ulubiony przejdź do menu kontekstowego, wybierz \'Opcje punktu\' -&gt; \'Dodaj do ulubionych\' i wprowadź jego nazwę. Po zapisaniu, punkt będzie można znaleźć w głównym menu -&gt; \'Ulubione\'. \n\tAby zapisać punkt jako ulubiony przejdź do menu kontekstowego, wybierz \'Opcje punktu\' -&gt; \'Dodaj do ulubionych\' i wprowadź jego nazwę. Po zapisaniu, punkt będzie można znaleźć w głównym menu -&gt; \'Ulubione\'.
\n\tDłuższe naciśnięcie pozycji w \'Ulubionych\' pokaże opcje dotyczące tego punktu. \n\tDłuższe naciśnięcie pozycji w \'Ulubionych\' pokaże opcje dotyczące tego punktu.
\n\tAby wyświetlić wszystkie ulubione punkty bezpośrednio na mapie, włącz warstwę \'Ulubione\' w \'Zdefiniuj widok\'.</string> \n\tAby wyświetlić wszystkie ulubione punkty bezpośrednio na mapie, włącz warstwę \'Ulubione\' w \'Zdefiniuj widok\'.</string>
@ -306,7 +306,7 @@
<string name="gps_status_app_not_found">GPS Status application not installed. Search in Market?</string> <string name="gps_status_app_not_found">GPS Status application not installed. Search in Market?</string>
<string name="voice_is_not_available_msg">Voice guidance is not available. Please go to settings, choose preferred voice data package, and download it.</string> <string name="voice_is_not_available_msg">Głos nawigatora nie jest dostępny. Przejdź do ustawień, wybierz ulubiony zestaw i zainstaluj go.</string>
<string name="voice_is_not_available_title">Nie wybrano głosu nawigatora</string> <string name="voice_is_not_available_title">Nie wybrano głosu nawigatora</string>
<string name="daynight_mode_day">Dzień</string> <string name="daynight_mode_day">Dzień</string>
<string name="daynight_mode_night">Noc</string> <string name="daynight_mode_night">Noc</string>
@ -373,7 +373,7 @@
<string name="vector_data">Mapy wektorowe offline</string> <string name="vector_data">Mapy wektorowe offline</string>
<string name="transport_context_menu">Search transport at stop</string> <string name="transport_context_menu">Search transport at stop</string>
<string name="point_on_map">Punkt na mapie:\n Lat {0,number,#.####}\n Lon {1,number,#.####}</string> <string name="point_on_map">Punkt na mapie:\n Szer. {0,number,#.####}\n Dł. {1,number,#.####}</string>
<string name="osb_bug_name">Błąd</string> <string name="osb_bug_name">Błąd</string>
<string name="poi_context_menu_modify">Modyfikuj POI</string> <string name="poi_context_menu_modify">Modyfikuj POI</string>
<string name="poi_context_menu_delete">Usuń POI</string> <string name="poi_context_menu_delete">Usuń POI</string>
@ -405,7 +405,7 @@
<string name="layer_poi">POI...</string> <string name="layer_poi">POI...</string>
<string name="layer_map">Źródło mapy...</string> <string name="layer_map">Źródło mapy...</string>
<string name="menu_layers">Zdefiniuj widok</string> <string name="menu_layers">Zdefiniuj widok</string>
<string name="continue_follow_previous_route">Previous route was unfinished. Continue following it?</string> <string name="continue_follow_previous_route">Poprzednia trasa nie została ukończona. Czy chcesz kontynuować?</string>
<string name="context_menu_item_search_poi">Szukaj POI</string> <string name="context_menu_item_search_poi">Szukaj POI</string>
<string name="context_menu_item_show_route">Trasa z</string> <string name="context_menu_item_show_route">Trasa z</string>
<string name="use_trackball_descr">Użyj trackballa do przesuwania mapy</string> <string name="use_trackball_descr">Użyj trackballa do przesuwania mapy</string>
@ -426,13 +426,13 @@
<string name="background_router_service_descr">Enable background service to track position over long time periods</string> <string name="background_router_service_descr">Enable background service to track position over long time periods</string>
<string name="background_router_service">Użyj usługi w tle</string> <string name="background_router_service">Użyj usługi w tle</string>
<string name="off_router_service_no_gps_available">The background routing service requires a location source to be turned on.</string> <string name="off_router_service_no_gps_available">The background routing service requires a location source to be turned on.</string>
<string name="routing_settings_descr">Specify routing options</string> <string name="routing_settings_descr">Skonfiguruj opcje routingu</string>
<string name="routing_settings">Nawigacja</string> <string name="routing_settings">Nawigacja</string>
<string name="hide_poi_filter">Ukryj filtr</string> <string name="hide_poi_filter">Ukryj filtr</string>
<string name="show_poi_filter">Pokaż filtr</string> <string name="show_poi_filter">Pokaż filtr</string>
<string name="search_poi_filter">Filtr</string> <string name="search_poi_filter">Filtr</string>
<string name="menu_mute_off">Dźwięk włączony</string> <string name="menu_mute_off">Wył. dźwięk</string>
<string name="menu_mute_on">Dźwięk wyłączony</string> <string name="menu_mute_on">Wł. dźwięk</string>
<string name="voice_provider_descr">Wybierz głos nawigatora</string> <string name="voice_provider_descr">Wybierz głos nawigatora</string>
<string name="voice_provider">Głos nawigatora</string> <string name="voice_provider">Głos nawigatora</string>
<string name="voice_data_initializing">Inicjalizacja danych głosowych...</string> <string name="voice_data_initializing">Inicjalizacja danych głosowych...</string>
@ -478,8 +478,8 @@
<string name="transport_route_distance">Długość trasy</string> <string name="transport_route_distance">Długość trasy</string>
<string name="transport">Transport</string> <string name="transport">Transport</string>
<string name="default_buttons_ok">OK</string> <string name="default_buttons_ok">OK</string>
<string name="show_transport_over_map_description">Show public transport stops on map</string> <string name="show_transport_over_map_description">Pokaż na mapie przystanki transportu publicznego</string>
<string name="show_transport_over_map">Show transport stops</string> <string name="show_transport_over_map">Pokaż przystanki</string>
<string name="hello">Program do nawigacji satelitarnej OsmAnd</string> <string name="hello">Program do nawigacji satelitarnej OsmAnd</string>
<string name="update_poi_success">POI data was updated successfully ({0} were loaded)</string> <string name="update_poi_success">POI data was updated successfully ({0} were loaded)</string>
<string name="update_poi_error_local">Error updating local POI list</string> <string name="update_poi_error_local">Error updating local POI list</string>
@ -495,7 +495,7 @@
<string name="search_history_navigate_to">Naviguj do szer. = {0}, dł. = {1}</string> <string name="search_history_navigate_to">Naviguj do szer. = {0}, dł. = {1}</string>
<string name="favorite">Ulubione</string> <string name="favorite">Ulubione</string>
<string name="clear_all">Wyczyść wszystko</string> <string name="clear_all">Wyczyść wszystko</string>
<string name="history">History</string> <string name="history">Historia</string>
<string name="uploading_data">Wysyłanie danych...</string> <string name="uploading_data">Wysyłanie danych...</string>
<string name="uploading">Wysyłanie...</string> <string name="uploading">Wysyłanie...</string>
<string name="search_nothing_found">Nic nie znaleziono</string> <string name="search_nothing_found">Nic nie znaleziono</string>
@ -505,7 +505,7 @@
<string name="hint_search_online">Numer domu, ulica, miejscowość</string> <string name="hint_search_online">Numer domu, ulica, miejscowość</string>
<string name="search_offline_address">Offline</string> <string name="search_offline_address">Offline</string>
<string name="search_online_address">Internet</string> <string name="search_online_address">Internet</string>
<string name="max_level_download_tile">Max. online zoom</string> <string name="max_level_download_tile">Maks. zoom online</string>
<string name="max_level_download_tile_descr">Choose maximum zoom level to download for online map tiles</string> <string name="max_level_download_tile_descr">Choose maximum zoom level to download for online map tiles</string>
<string name="route_about">O trasie</string> <string name="route_about">O trasie</string>
<string name="route_general_information">Dystans całkowity {0}, czas podróży {1} h {2} m.</string> <string name="route_general_information">Dystans całkowity {0}, czas podróży {1} h {2} m.</string>
@ -540,7 +540,7 @@
<string name="loading_poi_obj">Wczytywanie POI...</string> <string name="loading_poi_obj">Wczytywanie POI...</string>
<string name="auth_failed">Autoryzacja nie powiodła się</string> <string name="auth_failed">Autoryzacja nie powiodła się</string>
<string name="failed_op">nie powiodło się</string> <string name="failed_op">nie powiodło się</string>
<string name="converting_names">Konwertowanie Converting native/English names...</string> <string name="converting_names">Konwertowanie natywnych/angielskich nazw...</string>
<string name="loading_streets_buildings">Wczytywanie ulic/budynków...</string> <string name="loading_streets_buildings">Wczytywanie ulic/budynków...</string>
<string name="loading_postcodes">Wczytywanie kodów pocztowych...</string> <string name="loading_postcodes">Wczytywanie kodów pocztowych...</string>
<string name="loading_streets">Wczytywanie ulic...</string> <string name="loading_streets">Wczytywanie ulic...</string>
@ -569,16 +569,16 @@
<string name="use_online_routing">Użyj routingu online</string> <string name="use_online_routing">Użyj routingu online</string>
<string name="user_password_descr">Twoje hasło do konta OSM</string> <string name="user_password_descr">Twoje hasło do konta OSM</string>
<string name="user_password">Hasło do konta OSM</string> <string name="user_password">Hasło do konta OSM</string>
<string name="osm_settings_descr">Specify Openstreetmap.org (OSM) settings needed for OSM submissions</string> <string name="osm_settings_descr">Skonfiguruj ustawienia dotyczące potrzebne do wysyłania danych do Openstreetmap.org (OSM)</string>
<string name="monitor_preferences_descr">Specify tracking settings</string> <string name="monitor_preferences_descr">Skonfiguruj zapisywanie śladów GPX</string>
<string name="data_settings_descr">Ustaw język, pobierz/przeładuj dane</string> <string name="data_settings_descr">Ustaw język, pobierz/przeładuj dane</string>
<string name="data_settings">Dane</string> <string name="data_settings">Dane</string>
<string name="map_preferences_descr">Specify map settings: map source, rotation, marker position, screen orientation</string> <string name="map_preferences_descr">Zmień ustawienia mapy: źródło mapy, obracanie, pozycję markera, orientację ekranu</string>
<string name="osm_settings">OSM</string> <string name="osm_settings">OSM</string>
<string name="auto_zoom_map_descr">Dostosuj zoom mapy do Twojej prędkości</string> <string name="auto_zoom_map_descr">Dostosuj zoom mapy do Twojej prędkości</string>
<string name="auto_zoom_map">Autozoom mapy</string> <string name="auto_zoom_map">Autozoom mapy</string>
<string name="additional_settings">Ustawienia dodatkowe</string> <string name="additional_settings">Ustawienia dodatkowe</string>
<string name="settings_preset_descr">Wybierz profil. (Ustawienia każdego profilu mogą być zmieniane poniżej.)</string> <string name="settings_preset_descr">Wybierz profil nawigacji (ustawienia każdego profilu mogą być zmieniane poniżej).</string>
<string name="settings_preset">Tryb programu</string> <string name="settings_preset">Tryb programu</string>
<string name="settings">Ustawienia</string> <string name="settings">Ustawienia</string>
<string name="save_current_track_descr">Zapisz bieżący ślad do karty SD</string> <string name="save_current_track_descr">Zapisz bieżący ślad do karty SD</string>
@ -596,10 +596,10 @@
<string name="mark_point">Cel</string> <string name="mark_point">Cel</string>
<string name="show_osm_bugs_descr">Pokaż OpenStreetBugs na mapie</string> <string name="show_osm_bugs_descr">Pokaż OpenStreetBugs na mapie</string>
<string name="show_osm_bugs">Pokaż OpenStreetBugs</string> <string name="show_osm_bugs">Pokaż OpenStreetBugs</string>
<string name="favourites_activity">List of favorite points</string> <string name="favourites_activity">Lista ulubionych punktów</string>
<string name="add_to_favourite">Add to Favorites</string> <string name="add_to_favourite">Dodaj do ulubionych</string>
<string name="use_english_names_descr">Select between native and English names</string> <string name="use_english_names_descr">Zaznacz, jeśli chcesz używać angielskich nazw zamiast natywnych</string>
<string name="use_english_names">Use english names</string> <string name="use_english_names">Używaj angielskich nazw</string>
<string name="app_settings">Ustawienia programu</string> <string name="app_settings">Ustawienia programu</string>
<string name="search_address">Szukaj adresu</string> <string name="search_address">Szukaj adresu</string>
<string name="choose_building">Wybierz nr domu</string> <string name="choose_building">Wybierz nr domu</string>
@ -616,7 +616,7 @@
<string name="map_view_3d_descr">Włącz widok 3D mapy</string> <string name="map_view_3d_descr">Włącz widok 3D mapy</string>
<string name="map_view_3d">Widok 3D mapy</string> <string name="map_view_3d">Widok 3D mapy</string>
<string name="show_poi_over_map_description">Show POI over map (use last chosen filter)</string> <string name="show_poi_over_map_description">Pokaż POI na mapie (używa ostatnio wybranego filtru)</string>
<string name="show_poi_over_map">Pokaż POI</string> <string name="show_poi_over_map">Pokaż POI</string>
<string name="map_tile_source_descr">Wybierz źródło mapy kafelkowej (online lub offline): </string> <string name="map_tile_source_descr">Wybierz źródło mapy kafelkowej (online lub offline): </string>
<string name="map_tile_source">Źródło mapy kafelkowej</string> <string name="map_tile_source">Źródło mapy kafelkowej</string>
@ -672,7 +672,7 @@
<string name="search_address_building_option">Budynek</string> <string name="search_address_building_option">Budynek</string>
<string name="search_address_street_option">Przecinająca ulica (przecznica)</string> <string name="search_address_street_option">Przecinająca ulica (przecznica)</string>
<string name="search_tabs_location">Pozycja</string> <string name="search_tabs_location">Pozycja GPS</string>
<string name="context_menu_item_navigate_point">Nawiguj do punktu</string> <string name="context_menu_item_navigate_point">Nawiguj do punktu</string>
<string name="context_menu_item_add_favorite">Dodaj do ulubionych</string> <string name="context_menu_item_add_favorite">Dodaj do ulubionych</string>
@ -695,26 +695,26 @@
<string name="favourites_context_menu_delete">Usuń</string> <string name="favourites_context_menu_delete">Usuń</string>
<string name="favourites_edit_dialog_title">Zmień nazwę</string> <string name="favourites_edit_dialog_title">Zmień nazwę</string>
<string name="favourites_remove_dialog_title">Are you sure to remove favorite point?</string> <string name="favourites_remove_dialog_title">Czy na pewno chcesz usunąć ulubiony punkt?</string>
<string name="favourites_remove_dialog_success">Favorite point {0} was succesfully deleted.</string> <string name="favourites_remove_dialog_success">Ulubiony punkt {0} został usunięty.</string>
<string name="osb_add_dialog_title">Wprowadź opis błędu</string> <string name="osb_add_dialog_title">Wprowadź opis błędu</string>
<string name="osb_add_dialog_success">Błąd złoszony</string> <string name="osb_add_dialog_success">Błąd został zgłoszony</string>
<string name="osb_add_dialog_error">Wystąpił błąd, zgłoszenie nie zostało utworzone</string> <string name="osb_add_dialog_error">Wystąpił błąd, zgłoszenie nie zostało utworzone</string>
<string name="osb_comment_menu_item">Dodaj komentarz</string> <string name="osb_comment_menu_item">Dodaj komentarz</string>
<string name="osb_comment_dialog_message">Wiadomość</string> <string name="osb_comment_dialog_message">Wiadomość</string>
<string name="osb_comment_dialog_author">Author name</string> <string name="osb_comment_dialog_author">Author name</string>
<string name="osb_comment_dialog_title">Adding comment to bug</string> <string name="osb_comment_dialog_title">Dodaj komentarz do błędu</string>
<string name="osb_comment_dialog_add_button">Dodaj komentarz</string> <string name="osb_comment_dialog_add_button">Dodaj komentarz</string>
<string name="osb_comment_dialog_success">Dodano komentarz</string> <string name="osb_comment_dialog_success">Dodano komentarz</string>
<string name="osb_comment_dialog_error">Wystąpił błąd, komentarz nie został dodany</string> <string name="osb_comment_dialog_error">Wystąpił błąd, komentarz nie został dodany</string>
<string name="osb_close_menu_item">Close bug</string> <string name="osb_close_menu_item">Zamknij błąd</string>
<string name="osb_close_dialog_title">Closing bug</string> <string name="osb_close_dialog_title">Zamykanie błędu</string>
<string name="osb_close_dialog_close_button">Close bug</string> <string name="osb_close_dialog_close_button">Zamknij błąd</string>
<string name="osb_close_dialog_success">Bug was successfully closed</string> <string name="osb_close_dialog_success">Błąd został zamknięty</string>
<string name="osb_close_dialog_error">Exception occured: bug was not closed</string> <string name="osb_close_dialog_error">Wystąpił problem, błąd nie został zamknięty</string>
<string name="poi_edit_title">Edytuj POI</string> <string name="poi_edit_title">Edytuj POI</string>
<string name="poi_create_title">Dodaj POI</string> <string name="poi_create_title">Dodaj POI</string>
@ -746,4 +746,26 @@
<string name="edit_filter_create_message">Filtr {0} został utworzony</string> <string name="edit_filter_create_message">Filtr {0} został utworzony</string>
<string name="default_buttons_selectall">Zaznacz wszystko</string> <string name="default_buttons_selectall">Zaznacz wszystko</string>
<string name="layer_poi_label">Etykiety POI</string>
<string name="auto_follow_route_navigation_descr">Włącz autostart nawigatora tylko w trybie nawigacji.</string>
<string name="auto_follow_route_navigation">Autostart nawigatora</string>
<string name="auto_follow_location_enabled">Autostart nawigatora jest włączony.</string>
<string name="animate_route_off">Wył. animacje</string>
<string name="animate_route">Wł. animacje</string>
<string name="tip_recent_changes_0_6_8_t">Zmiany w wersji 0.6.8:
\n\t- całkowicie przeprojektowano wyszukiwanie (POI, adresy) - teraz jest szysbsze i bardziej responsywne
\n\t- zaimplementowano wyszukiwanie POI po nazwie na dużych obszarach (krajach)
\n\t- naprawiono migotanie ekranu na tabletach (zgłoszenie nr 641)
\n\t- dodano opcję autostartu nawigacji (zgłoszenie nr 356)
\n\t- nawigacja wg śladu GPX przeniesiona została do menu \'Nawigacja\'
\n\t- dane POI teraz są w plikach .obf
\n\t- poprawiono błedy komunikatów głosowych (ustalenie pozycji GPS, pomijanie pierwszej komendy)
\n\t- naprawiono inne, drobne błędy
</string>
<string name="file_can_not_be_renamed">Nazwa pliku nie może zostać zmieniona.</string>
<string name="file_with_name_already_exists">Plik o takiej nazwie już istnieje.</string>
<string name="gpx_navigation">Trasa GPX</string>
</resources> </resources>

View file

@ -4,22 +4,21 @@ import java.io.File;
import java.util.List; import java.util.List;
import java.util.Stack; import java.util.Stack;
import org.apache.commons.logging.Log;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import net.osmand.Algoritms; import net.osmand.Algoritms;
import net.osmand.LogUtil; import net.osmand.LogUtil;
import net.osmand.ResultMatcher; import net.osmand.ResultMatcher;
import net.osmand.data.Amenity; import net.osmand.data.Amenity;
import net.osmand.data.MapTileDownloader; import net.osmand.data.MapTileDownloader;
import net.osmand.data.TransportStop;
import net.osmand.data.MapTileDownloader.DownloadRequest; import net.osmand.data.MapTileDownloader.DownloadRequest;
import net.osmand.data.MapTileDownloader.IMapDownloaderCallback; import net.osmand.data.MapTileDownloader.IMapDownloaderCallback;
import net.osmand.data.TransportStop;
import net.osmand.map.ITileSource; import net.osmand.map.ITileSource;
import org.apache.commons.logging.Log;
import android.os.Handler;
import android.os.HandlerThread;
/** /**
* Thread to load map objects (POI, transport stops )async * Thread to load map objects (POI, transport stops )async
*/ */

View file

@ -752,6 +752,7 @@ public class OsmandSettings {
public static final String LAST_KNOWN_MAP_LON = "last_known_map_lon"; //$NON-NLS-1$ public static final String LAST_KNOWN_MAP_LON = "last_known_map_lon"; //$NON-NLS-1$
public static final String LAST_KNOWN_MAP_ZOOM = "last_known_map_zoom"; //$NON-NLS-1$ public static final String LAST_KNOWN_MAP_ZOOM = "last_known_map_zoom"; //$NON-NLS-1$
public static final String MAP_LABEL_TO_SHOW = "map_label_to_show"; //$NON-NLS-1$
public static final String MAP_LAT_TO_SHOW = "map_lat_to_show"; //$NON-NLS-1$ public static final String MAP_LAT_TO_SHOW = "map_lat_to_show"; //$NON-NLS-1$
public static final String MAP_LON_TO_SHOW = "map_lon_to_show"; //$NON-NLS-1$ public static final String MAP_LON_TO_SHOW = "map_lon_to_show"; //$NON-NLS-1$
public static final String MAP_ZOOM_TO_SHOW = "map_zoom_to_show"; //$NON-NLS-1$ public static final String MAP_ZOOM_TO_SHOW = "map_zoom_to_show"; //$NON-NLS-1$
@ -766,13 +767,6 @@ public class OsmandSettings {
return globalPreferences.contains(LAST_KNOWN_MAP_LAT); return globalPreferences.contains(LAST_KNOWN_MAP_LAT);
} }
public void setMapLocationToShow(double latitude, double longitude) {
setMapLocationToShow(latitude, longitude, getLastKnownMapZoom(), null);
}
public void setMapLocationToShow(double latitude, double longitude, int zoom) {
setMapLocationToShow(latitude, longitude, null);
}
public LatLon getAndClearMapLocationToShow(){ public LatLon getAndClearMapLocationToShow(){
if(!globalPreferences.contains(MAP_LAT_TO_SHOW)){ if(!globalPreferences.contains(MAP_LAT_TO_SHOW)){
@ -784,14 +778,26 @@ public class OsmandSettings {
return new LatLon(lat, lon); return new LatLon(lat, lon);
} }
public String getAndClearMapLabelToShow(){
String label = globalPreferences.getString(MAP_LABEL_TO_SHOW, null);
globalPreferences.edit().remove(MAP_LABEL_TO_SHOW).commit();
return label;
}
public int getMapZoomToShow() { public int getMapZoomToShow() {
return globalPreferences.getInt(MAP_ZOOM_TO_SHOW, 5); return globalPreferences.getInt(MAP_ZOOM_TO_SHOW, 5);
} }
public void setMapLocationToShow(double latitude, double longitude, int zoom, String historyDescription) { public void setMapLocationToShow(double latitude, double longitude, int zoom, String historyDescription,
String labelToShow) {
Editor edit = globalPreferences.edit(); Editor edit = globalPreferences.edit();
edit.putFloat(MAP_LAT_TO_SHOW, (float) latitude); edit.putFloat(MAP_LAT_TO_SHOW, (float) latitude);
edit.putFloat(MAP_LON_TO_SHOW, (float) longitude); edit.putFloat(MAP_LON_TO_SHOW, (float) longitude);
if (labelToShow != null) {
edit.putString(MAP_LABEL_TO_SHOW, labelToShow);
} else {
edit.remove(MAP_LABEL_TO_SHOW);
}
edit.putInt(MAP_ZOOM_TO_SHOW, zoom); edit.putInt(MAP_ZOOM_TO_SHOW, zoom);
edit.commit(); edit.commit();
if(historyDescription != null){ if(historyDescription != null){
@ -799,8 +805,12 @@ public class OsmandSettings {
} }
} }
public void setMapLocationToShow(double latitude, double longitude, String historyDescription) { public void setMapLocationToShow(double latitude, double longitude, int zoom) {
setMapLocationToShow(latitude, longitude, getLastKnownMapZoom(), historyDescription); setMapLocationToShow(latitude, longitude, zoom, null, null);
}
public void setMapLocationToShow(double latitude, double longitude, int zoom, String historyDescription){
setMapLocationToShow(latitude, longitude, zoom, historyDescription, historyDescription);
} }
// Do not use that method if you want to show point on map. Use setMapLocationToShow // Do not use that method if you want to show point on map. Use setMapLocationToShow

View file

@ -13,6 +13,9 @@ public class RotatedTileBox {
private int zoom; private int zoom;
private float rotateCos; private float rotateCos;
private float rotateSin; private float rotateSin;
private RectF latLon;
private boolean rendering;
private RotatedTileBox parent;
public RotatedTileBox(float leftTileX, float topTileY, float tileWidth, float tileHeight, float rotate, int zoom) { public RotatedTileBox(float leftTileX, float topTileY, float tileWidth, float tileHeight, float rotate, int zoom) {
set(leftTileX, topTileY, tileWidth, tileHeight, rotate, zoom); set(leftTileX, topTileY, tileWidth, tileHeight, rotate, zoom);
@ -20,6 +23,9 @@ public class RotatedTileBox {
public RotatedTileBox(RotatedTileBox r){ public RotatedTileBox(RotatedTileBox r){
set(r.leftTileX, r.topTileY, r.tileWidth, r.tileHeight, r.rotate, r.zoom); set(r.leftTileX, r.topTileY, r.tileWidth, r.tileHeight, r.rotate, r.zoom);
this.latLon = r.latLon;
this.rendering = r.rendering;
this.parent = r;
} }
private void init() { private void init() {
@ -166,6 +172,61 @@ public class RotatedTileBox {
return calcPointTileY(tileWidth, tileHeight); return calcPointTileY(tileWidth, tileHeight);
} }
/**
* the lat lon bounds
* @param latLonBounds
*/
public void setLatLon(RectF latLonBounds) {
//on new latLonBounds reset rendering info and latLonBounds....
if (!latLonBounds.equals(this.latLon)) {
this.rendering = false;
this.latLon = latLonBounds;
}
}
/**
* @return true if rendering is in progress
*/
public boolean isRendering() {
return rendering;
}
/**
* Say we are rendering this box
*/
public void rendering() {
rendering = true;
if (parent != null) {
parent.rendering(latLon);
}
}
/**
* Say we are rendering this box for this coordinates
*
* @param aLatLon
*/
private void rendering(RectF aLatLon) {
if (aLatLon.equals(latLon)) {
rendering = true;
}
}
/**
* all if rendering was interrupted
*/
public void renderingInterrupted() {
rendered();
}
/**
* Call if rendering is finished
*/
public void rendered() {
rendering = false;
if (parent != null) {
parent.rendered();
}
}
} }

View file

@ -229,8 +229,10 @@ public class FavouritesActivity extends ExpandableListActivity {
} }
} else { } else {
FavouritePoint point = (FavouritePoint) favouritesAdapter.getChild(groupPosition, childPosition); FavouritePoint point = (FavouritePoint) favouritesAdapter.getChild(groupPosition, childPosition);
OsmandSettings.getOsmandSettings(this).SHOW_FAVORITES.set( true); OsmandSettings settings = OsmandSettings.getOsmandSettings(this);
OsmandSettings.getOsmandSettings(this).setMapLocationToShow(point.getLatitude(), point.getLongitude(), getString(R.string.favorite)+" : " + point.getName()); //$NON-NLS-1$ settings.SHOW_FAVORITES.set(true);
settings.setMapLocationToShow(point.getLatitude(), point.getLongitude(),
Math.max(12, settings.getLastKnownMapZoom()), null, getString(R.string.favorite)+" : " + point.getName());
MapActivity.launchMapActivityMoveToTop(FavouritesActivity.this); MapActivity.launchMapActivityMoveToTop(FavouritesActivity.this);
} }
return true; return true;
@ -244,8 +246,10 @@ public class FavouritesActivity extends ExpandableListActivity {
int group = ExpandableListView.getPackedPositionGroup(((ExpandableListContextMenuInfo)menuInfo).packedPosition); int group = ExpandableListView.getPackedPositionGroup(((ExpandableListContextMenuInfo)menuInfo).packedPosition);
final FavouritePoint point = (FavouritePoint) favouritesAdapter.getChild(group, child); final FavouritePoint point = (FavouritePoint) favouritesAdapter.getChild(group, child);
if (aItem.getItemId() == SHOW_ON_MAP) { if (aItem.getItemId() == SHOW_ON_MAP) {
OsmandSettings.getOsmandSettings(this).SHOW_FAVORITES.set( true); OsmandSettings settings = OsmandSettings.getOsmandSettings(this);
OsmandSettings.getOsmandSettings(this).setMapLocationToShow(point.getLatitude(), point.getLongitude(), getString(R.string.favorite)+" : " + point.getName()); settings.SHOW_FAVORITES.set(true);
settings.setMapLocationToShow(point.getLatitude(), point.getLongitude(),
Math.max(12, settings.getLastKnownMapZoom()), null, getString(R.string.favorite)+" : " + point.getName());
MapActivity.launchMapActivityMoveToTop(this); MapActivity.launchMapActivityMoveToTop(this);
} else if (aItem.getItemId() == NAVIGATE_TO) { } else if (aItem.getItemId() == NAVIGATE_TO) {
OsmandSettings.getOsmandSettings(this).setPointToNavigate(point.getLatitude(), point.getLongitude(), getString(R.string.favorite)+" : " + point.getName()); OsmandSettings.getOsmandSettings(this).setPointToNavigate(point.getLatitude(), point.getLongitude(), getString(R.string.favorite)+" : " + point.getName());

View file

@ -124,8 +124,9 @@ public class FavouritesListActivity extends ListActivity implements SearchActivi
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
if (which == 0) { if (which == 0) {
OsmandSettings.getOsmandSettings(FavouritesListActivity.this).setMapLocationToShow(entry.getLatitude(), OsmandSettings settings = OsmandSettings.getOsmandSettings(FavouritesListActivity.this);
entry.getLongitude()); settings.setMapLocationToShow(entry.getLatitude(), entry.getLongitude(), settings.getLastKnownMapZoom(),
null, getString(R.string.favorite)+" : " + entry.getName()); //$NON-NLS-1$
} else if (which == 1) { } else if (which == 1) {
OsmandSettings.getOsmandSettings(FavouritesListActivity.this).setPointToNavigate(entry.getLatitude(), OsmandSettings.getOsmandSettings(FavouritesListActivity.this).setPointToNavigate(entry.getLatitude(),
entry.getLongitude(), getString(R.string.favorite) + " : " + entry.getName()); entry.getLongitude(), getString(R.string.favorite) + " : " + entry.getName());
@ -140,10 +141,13 @@ public class FavouritesListActivity extends ListActivity implements SearchActivi
@Override @Override
protected void onListItemClick(ListView l, View v, int position, long id) { protected void onListItemClick(ListView l, View v, int position, long id) {
if (!isSelectFavoriteMode()) { if (!isSelectFavoriteMode()) {
OsmandSettings settings = OsmandSettings.getOsmandSettings(this);
FavouritePoint point = favouritesAdapter.getItem(position); FavouritePoint point = favouritesAdapter.getItem(position);
OsmandSettings.getOsmandSettings(this).SHOW_FAVORITES.set( true); settings.SHOW_FAVORITES.set(true);
OsmandSettings.getOsmandSettings(this).setMapLocationToShow(point.getLatitude(), point.getLongitude(), getString(R.string.favorite)+" : " + point.getName()); //$NON-NLS-1$ settings.setMapLocationToShow(point.getLatitude(), point.getLongitude(), settings.getLastKnownMapZoom(), null,
getString(R.string.favorite) + " : " + point.getName()); //$NON-NLS-1$
MapActivity.launchMapActivityMoveToTop(FavouritesListActivity.this); MapActivity.launchMapActivityMoveToTop(FavouritesListActivity.this);
} else { } else {
Intent intent = getIntent(); Intent intent = getIntent();

View file

@ -154,7 +154,8 @@ public class LocalIndexesActivity extends ExpandableListActivity {
if (info != null && info.getGpxFile() != null) { if (info != null && info.getGpxFile() != null) {
WptPt loc = info.getGpxFile().findPointToShow(); WptPt loc = info.getGpxFile().findPointToShow();
if (loc != null) { if (loc != null) {
OsmandSettings.getOsmandSettings(LocalIndexesActivity.this).setMapLocationToShow(loc.lat, loc.lon); OsmandSettings settings = OsmandSettings.getOsmandSettings(LocalIndexesActivity.this);
settings.setMapLocationToShow(loc.lat, loc.lon, settings.getLastKnownMapZoom());
} }
((OsmandApplication) getApplication()).setGpxFileToDisplay(info.getGpxFile()); ((OsmandApplication) getApplication()).setGpxFileToDisplay(info.getGpxFile());
MapActivity.launchMapActivityMoveToTop(LocalIndexesActivity.this); MapActivity.launchMapActivityMoveToTop(LocalIndexesActivity.this);

View file

@ -292,9 +292,19 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso
showAndHideMapPosition(); showAndHideMapPosition();
LatLon cur = new LatLon(mapView.getLatitude(), mapView.getLongitude()); LatLon cur = new LatLon(mapView.getLatitude(), mapView.getLongitude());
LatLon latLon = settings.getAndClearMapLocationToShow(); LatLon latLonToShow = settings.getAndClearMapLocationToShow();
if (latLon != null && !latLon.equals(cur)) { String mapLabelToShow = settings.getAndClearMapLabelToShow();
mapView.getAnimatedDraggingThread().startMoving(latLon.getLatitude(), latLon.getLongitude(), settings.getMapZoomToShow(), true); if(mapLabelToShow != null && latLonToShow != null){
if(mapLabelToShow.length() == 0){
mapLayers.getContextMenuLayer().setLocation(latLonToShow, mapLabelToShow);
} else {
mapLayers.getContextMenuLayer().setLocation(latLonToShow, mapLabelToShow);
}
}
if (latLonToShow != null && !latLonToShow.equals(cur)) {
mapView.getAnimatedDraggingThread().startMoving(latLonToShow.getLatitude(), latLonToShow.getLongitude(),
settings.getMapZoomToShow(), true);
} }
View progress = findViewById(R.id.ProgressBar); View progress = findViewById(R.id.ProgressBar);

View file

@ -169,7 +169,9 @@ public class NavigatePointActivity extends Activity implements SearchActivityChi
OsmandMapTileView v = activity.getMapView(); OsmandMapTileView v = activity.getMapView();
v.getAnimatedDraggingThread().startMoving(lat, lon, v.getZoom(), true); v.getAnimatedDraggingThread().startMoving(lat, lon, v.getZoom(), true);
} else { } else {
OsmandSettings.getOsmandSettings(this).setMapLocationToShow(lat, lon, MessageFormat.format(getString(R.string.search_history_navigate_to), lat, lon)); OsmandSettings settings = OsmandSettings.getOsmandSettings(this);
settings.setMapLocationToShow(lat, lon, Math.max(12, settings.getLastKnownMapZoom()),
MessageFormat.format(getString(R.string.search_history_navigate_to), lat, lon));
} }
} }
close(); close();

View file

@ -78,7 +78,9 @@ public class ShowRouteInfoActivity extends ListActivity {
RouteDirectionInfo item = ((RouteInfoAdapter)getListAdapter()).getItem(position - 1); RouteDirectionInfo item = ((RouteInfoAdapter)getListAdapter()).getItem(position - 1);
Location loc = helper.getLocationFromRouteDirection(item); Location loc = helper.getLocationFromRouteDirection(item);
if(loc != null){ if(loc != null){
OsmandSettings.getOsmandSettings(this).setMapLocationToShow(loc.getLatitude(),loc.getLongitude()); OsmandSettings settings = OsmandSettings.getOsmandSettings(this);
settings.setMapLocationToShow(loc.getLatitude(),loc.getLongitude(),
Math.max(13, settings.getLastKnownMapZoom()));
MapActivity.launchMapActivityMoveToTop(this); MapActivity.launchMapActivityMoveToTop(this);
} }
} }

View file

@ -18,6 +18,7 @@ import net.osmand.data.Street;
import net.osmand.osm.LatLon; import net.osmand.osm.LatLon;
import net.osmand.osm.MapUtils; import net.osmand.osm.MapUtils;
import net.osmand.osm.Node; import net.osmand.osm.Node;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.RegionAddressRepository; import net.osmand.plus.RegionAddressRepository;
import net.osmand.plus.ResourceManager; import net.osmand.plus.ResourceManager;
@ -154,11 +155,10 @@ public class GeoIntentActivity extends ListActivity {
@Override @Override
protected void onListItemClick(ListView l, View v, int position, long id) { protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id); super.onListItemClick(l, v, position, id);
MapObject item = ((MapObjectAdapter) getListAdapter()) MapObject item = ((MapObjectAdapter) getListAdapter()).getItem(position);
.getItem(position); OsmandSettings settings = getMyApplication().getSettings();
getMyApplication().getSettings().setMapLocationToShow(item.getLocation() settings.setMapLocationToShow(item.getLocation().getLatitude(), item.getLocation().getLongitude(),
.getLatitude(), item.getLocation().getLongitude(), settings.getLastKnownMapZoom(), getString(R.string.address) + " : " + item.toString()); //$NON-NLS-1$
getString(R.string.address) + " : " + item.toString()); //$NON-NLS-1$
MapActivity.launchMapActivityMoveToTop(this); MapActivity.launchMapActivityMoveToTop(this);
} }

View file

@ -209,7 +209,9 @@ public class SearchAddressOnlineActivity extends ListActivity implements SearchA
protected void onListItemClick(ListView l, View v, int position, long id) { protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id); super.onListItemClick(l, v, position, id);
Place item = ((PlacesAdapter) getListAdapter()).getItem(position); Place item = ((PlacesAdapter) getListAdapter()).getItem(position);
OsmandSettings.getOsmandSettings(this).setMapLocationToShow(item.lat, item.lon, getString(R.string.address)+ " : " + item.displayName); //$NON-NLS-1$ OsmandSettings settings = OsmandSettings.getOsmandSettings(this);
settings.setMapLocationToShow(item.lat, item.lon,
Math.max(15, settings.getLastKnownMapZoom()), getString(R.string.address)+ " : " + item.displayName); //$NON-NLS-1$
MapActivity.launchMapActivityMoveToTop(this); MapActivity.launchMapActivityMoveToTop(this);
} }

View file

@ -1,6 +1,5 @@
package net.osmand.plus.activities.search; package net.osmand.plus.activities.search;
import java.util.List; import java.util.List;
import net.osmand.OsmAndFormatter; import net.osmand.OsmAndFormatter;
@ -43,7 +42,6 @@ public class SearchHistoryActivity extends ListActivity implements SearchActivit
helper = SearchHistoryHelper.getInstance(); helper = SearchHistoryHelper.getInstance();
clearButton = new Button(this); clearButton = new Button(this);
clearButton.setText(R.string.clear_all); clearButton.setText(R.string.clear_all);
clearButton.setOnClickListener(new View.OnClickListener() { clearButton.setOnClickListener(new View.OnClickListener() {
@ -61,6 +59,7 @@ public class SearchHistoryActivity extends ListActivity implements SearchActivit
}); });
} }
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
@ -104,8 +103,9 @@ public class SearchHistoryActivity extends ListActivity implements SearchActivit
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
if (which == 0) { if (which == 0) {
OsmandSettings.getOsmandSettings(SearchHistoryActivity.this).setMapLocationToShow(entry.getLat(), OsmandSettings settings = OsmandSettings.getOsmandSettings(SearchHistoryActivity.this);
entry.getLon()); settings.setMapLocationToShow(entry.getLat(), entry.getLon(), settings.getLastKnownMapZoom(), null, entry
.getName());
} else if (which == 1) { } else if (which == 1) {
OsmandSettings.getOsmandSettings(SearchHistoryActivity.this).setPointToNavigate(entry.getLat(), entry.getLon(), OsmandSettings.getOsmandSettings(SearchHistoryActivity.this).setPointToNavigate(entry.getLat(), entry.getLon(),
null); null);
@ -118,7 +118,6 @@ public class SearchHistoryActivity extends ListActivity implements SearchActivit
return true; return true;
} }
@Override @Override
protected void onListItemClick(ListView l, View v, int position, long id) { protected void onListItemClick(ListView l, View v, int position, long id) {
HistoryEntry model = ((HistoryAdapter) getListAdapter()).getItem(position); HistoryEntry model = ((HistoryAdapter) getListAdapter()).getItem(position);
@ -127,11 +126,11 @@ public class SearchHistoryActivity extends ListActivity implements SearchActivit
private void selectModel(HistoryEntry model) { private void selectModel(HistoryEntry model) {
helper.selectEntry(model, this); helper.selectEntry(model, this);
OsmandSettings.getOsmandSettings(SearchHistoryActivity.this).setMapLocationToShow(model.getLat(), model.getLon()); OsmandSettings settings = OsmandSettings.getOsmandSettings(SearchHistoryActivity.this);
settings.setMapLocationToShow(model.getLat(), model.getLon(), settings.getLastKnownMapZoom(), null, model.getName());
MapActivity.launchMapActivityMoveToTop(this); MapActivity.launchMapActivityMoveToTop(this);
} }
class HistoryAdapter extends ArrayAdapter<HistoryEntry> { class HistoryAdapter extends ArrayAdapter<HistoryEntry> {
public HistoryAdapter(List<HistoryEntry> list) { public HistoryAdapter(List<HistoryEntry> list) {

View file

@ -196,6 +196,9 @@ public class MapRenderRepositories {
} }
public void interruptLoadingMap(){ public void interruptLoadingMap(){
if (requestedBox != null) {
requestedBox.renderingInterrupted();
}
interrupted = true; interrupted = true;
if(currentRenderingContext != null){ if(currentRenderingContext != null){
currentRenderingContext.interrupted = true; currentRenderingContext.interrupted = true;
@ -207,6 +210,9 @@ public class MapRenderRepositories {
private boolean checkWhetherInterrupted(){ private boolean checkWhetherInterrupted(){
if(interrupted || (currentRenderingContext != null && currentRenderingContext.interrupted)){ if(interrupted || (currentRenderingContext != null && currentRenderingContext.interrupted)){
if (requestedBox != null) {
requestedBox.renderingInterrupted();
}
requestedBox = bmpLocation; requestedBox = bmpLocation;
return true; return true;
} }
@ -356,6 +362,10 @@ public class MapRenderRepositories {
currentRenderingContext = null; currentRenderingContext = null;
} }
try { try {
// prevent editing
requestedBox = new RotatedTileBox(tileRect);
requestedBox.rendering();
// find selected rendering type // find selected rendering type
OsmandApplication app = ((OsmandApplication)context.getApplicationContext()); OsmandApplication app = ((OsmandApplication)context.getApplicationContext());
Boolean renderDay = app.getDaynightHelper().getDayNightRenderer(); Boolean renderDay = app.getDaynightHelper().getDayNightRenderer();
@ -363,9 +373,6 @@ public class MapRenderRepositories {
// boolean moreDetail = prefs.SHOW_MORE_MAP_DETAIL.get(); // boolean moreDetail = prefs.SHOW_MORE_MAP_DETAIL.get();
BaseOsmandRender renderingType = app.getRendererRegistry().getCurrentSelectedRenderer(); BaseOsmandRender renderingType = app.getRendererRegistry().getCurrentSelectedRenderer();
// prevent editing
requestedBox = new RotatedTileBox(tileRect);
// calculate data box // calculate data box
RectF dataBox = requestedBox.calculateLatLonBox(new RectF()); RectF dataBox = requestedBox.calculateLatLonBox(new RectF());
long now = System.currentTimeMillis(); long now = System.currentTimeMillis();
@ -419,7 +426,6 @@ public class MapRenderRepositories {
} }
renderer.generateNewBitmap(currentRenderingContext, cObjects, bmp, renderer.generateNewBitmap(currentRenderingContext, cObjects, bmp,
prefs.USE_ENGLISH_NAMES.get(), renderingType, stepByStep ? notifyList : null); prefs.USE_ENGLISH_NAMES.get(), renderingType, stepByStep ? notifyList : null);
String renderingDebugInfo = currentRenderingContext.renderingDebugInfo; String renderingDebugInfo = currentRenderingContext.renderingDebugInfo;
@ -468,9 +474,11 @@ public class MapRenderRepositories {
Toast.makeText(context, R.string.rendering_out_of_memory, Toast.LENGTH_SHORT).show(); Toast.makeText(context, R.string.rendering_out_of_memory, Toast.LENGTH_SHORT).show();
} }
}); });
} finally {
if (requestedBox != null) {
requestedBox.rendered();
}
} }
} }
public Bitmap getBitmap() { public Bitmap getBitmap() {

View file

@ -93,10 +93,11 @@ public class MapVectorLayer extends BaseMapLayer {
tileLayer.drawTileMap(canvas, tilesRect); tileLayer.drawTileMap(canvas, tilesRect);
resourceManager.getRenderer().interruptLoadingMap(); resourceManager.getRenderer().interruptLoadingMap();
} else { } else {
rotatedTileBox.setLatLon(latLonBounds);
if (!view.isZooming()) { if (!view.isZooming()) {
pixRect.set(0, 0, view.getWidth(), view.getHeight()); pixRect.set(0, 0, view.getWidth(), view.getHeight());
updateRotatedTileBox(); updateRotatedTileBox();
if (resourceManager.updateRenderedMapNeeded(rotatedTileBox)) { if (!rotatedTileBox.isRendering() && resourceManager.updateRenderedMapNeeded(rotatedTileBox)) {
// pixRect.set(-view.getWidth(), -view.getHeight() / 2, 2 * view.getWidth(), 3 * view.getHeight() / 2); // pixRect.set(-view.getWidth(), -view.getHeight() / 2, 2 * view.getWidth(), 3 * view.getHeight() / 2);
pixRect.set(-view.getWidth() / 3, -view.getHeight() / 4, 4 * view.getWidth() / 3, 5 * view.getHeight() / 4); pixRect.set(-view.getWidth() / 3, -view.getHeight() / 4, 4 * view.getWidth() / 3, 5 * view.getHeight() / 4);
updateRotatedTileBox(); updateRotatedTileBox();

View file

@ -123,6 +123,10 @@ public class ContextMenuLayer implements OsmandMapLayer {
public void setLocation(LatLon loc, String description){ public void setLocation(LatLon loc, String description){
latLon = loc; latLon = loc;
if(latLon != null){ if(latLon != null){
if(description == null || description.length() == 0){
description = MessageFormat.format(view.getContext().getString(R.string.point_on_map),
latLon.getLatitude(), latLon.getLongitude());
}
textView.setText(description); textView.setText(description);
} else { } else {
textView.setText(""); //$NON-NLS-1$ textView.setText(""); //$NON-NLS-1$
@ -151,8 +155,7 @@ public class ContextMenuLayer implements OsmandMapLayer {
} }
LatLon latLon = view.getLatLonFromScreenPoint(point.x, point.y); LatLon latLon = view.getLatLonFromScreenPoint(point.x, point.y);
String description = MessageFormat.format(view.getContext().getString(R.string.point_on_map), String description = "";
latLon.getLatitude(), latLon.getLongitude());
if(selectedObject != null){ if(selectedObject != null){
description = selectedContextProvider.getObjectDescription(selectedObject); description = selectedContextProvider.getObjectDescription(selectedObject);

View file

@ -183,7 +183,7 @@ public class OsmBugsLayer implements OsmandMapLayer, ContextMenuLayer.IContextMe
cRightLongitude = nRightLongitude; cRightLongitude = nRightLongitude;
cBottomLatitude = nBottomLatitude; cBottomLatitude = nBottomLatitude;
czoom = zoom; czoom = zoom;
view.refreshMap(); refreshMap();
} }
} }
} }
@ -200,7 +200,7 @@ public class OsmBugsLayer implements OsmandMapLayer, ContextMenuLayer.IContextMe
public OpenStreetBug getBugFromPoint(PointF point){ public OpenStreetBug getBugFromPoint(PointF point){
OpenStreetBug result = null; OpenStreetBug result = null;
if (objects != null) { if (objects != null && view != null) {
int ex = (int) point.x; int ex = (int) point.x;
int ey = (int) point.y; int ey = (int) point.y;
int radius = getRadiusBug(view.getZoom()) * 3 / 2; int radius = getRadiusBug(view.getZoom()) * 3 / 2;
@ -225,8 +225,8 @@ public class OsmBugsLayer implements OsmandMapLayer, ContextMenuLayer.IContextMe
public boolean onTouchEvent(PointF point) { public boolean onTouchEvent(PointF point) {
OpenStreetBug bug = getBugFromPoint(point); OpenStreetBug bug = getBugFromPoint(point);
if(bug != null){ if(bug != null){
String format = view.getContext().getString(R.string.osb_bug_name)+ " : " + bug.getName(); //$NON-NLS-1$ String format = activity.getString(R.string.osb_bug_name)+ " : " + bug.getName(); //$NON-NLS-1$
Toast.makeText(view.getContext(), format, Toast.LENGTH_LONG).show(); Toast.makeText(activity, format, Toast.LENGTH_LONG).show();
return true; return true;
} }
return false; return false;
@ -360,9 +360,7 @@ public class OsmBugsLayer implements OsmandMapLayer, ContextMenuLayer.IContextMe
if (bug) { if (bug) {
Toast.makeText(activity, activity.getResources().getString(R.string.osb_add_dialog_success), Toast.LENGTH_LONG).show(); Toast.makeText(activity, activity.getResources().getString(R.string.osb_add_dialog_success), Toast.LENGTH_LONG).show();
clearCache(); clearCache();
if (view.getLayers().contains(OsmBugsLayer.this)) { refreshMap();
view.refreshMap();
}
} else { } else {
Toast.makeText(activity, activity.getResources().getString(R.string.osb_add_dialog_error), Toast.LENGTH_LONG).show(); Toast.makeText(activity, activity.getResources().getString(R.string.osb_add_dialog_error), Toast.LENGTH_LONG).show();
openBugAlertDialog(latitude, longitude, text, author); openBugAlertDialog(latitude, longitude, text, author);
@ -374,7 +372,8 @@ public class OsmBugsLayer implements OsmandMapLayer, ContextMenuLayer.IContextMe
public void openBug(final double latitude, final double longitude){ public void openBug(final double latitude, final double longitude){
openBugAlertDialog(latitude, longitude, "", view.getSettings().USER_OSM_BUG_NAME.get()); OsmandSettings settings = OsmandSettings.getOsmandSettings(activity);
openBugAlertDialog(latitude, longitude, "", settings.USER_OSM_BUG_NAME.get());
} }
public void commentBug(final OpenStreetBug bug){ public void commentBug(final OpenStreetBug bug){
@ -400,9 +399,7 @@ public class OsmBugsLayer implements OsmandMapLayer, ContextMenuLayer.IContextMe
if (added) { if (added) {
Toast.makeText(activity, activity.getResources().getString(R.string.osb_comment_dialog_success), Toast.LENGTH_LONG).show(); Toast.makeText(activity, activity.getResources().getString(R.string.osb_comment_dialog_success), Toast.LENGTH_LONG).show();
clearCache(); clearCache();
if (OsmBugsLayer.this.view.getLayers().contains(OsmBugsLayer.this)) {
OsmBugsLayer.this.view.refreshMap();
}
} else { } else {
Toast.makeText(activity, activity.getResources().getString(R.string.osb_comment_dialog_error), Toast.LENGTH_LONG).show(); Toast.makeText(activity, activity.getResources().getString(R.string.osb_comment_dialog_error), Toast.LENGTH_LONG).show();
} }
@ -411,6 +408,12 @@ public class OsmBugsLayer implements OsmandMapLayer, ContextMenuLayer.IContextMe
return builder.create(); return builder.create();
} }
public void refreshMap(){
if (view != null && view.getLayers().contains(OsmBugsLayer.this)) {
view.refreshMap();
}
}
public void closeBug(final OpenStreetBug bug){ public void closeBug(final OpenStreetBug bug){
dialogBundle.putSerializable(KEY_BUG, bug); dialogBundle.putSerializable(KEY_BUG, bug);
activity.showDialog(DIALOG_CLOSE_BUG); activity.showDialog(DIALOG_CLOSE_BUG);
@ -428,9 +431,7 @@ public class OsmBugsLayer implements OsmandMapLayer, ContextMenuLayer.IContextMe
if (closed) { if (closed) {
Toast.makeText(activity, activity.getString(R.string.osb_close_dialog_success), Toast.LENGTH_LONG).show(); Toast.makeText(activity, activity.getString(R.string.osb_close_dialog_success), Toast.LENGTH_LONG).show();
clearCache(); clearCache();
if (OsmBugsLayer.this.view.getLayers().contains(OsmBugsLayer.this)) { refreshMap();
OsmBugsLayer.this.view.refreshMap();
}
} else { } else {
Toast.makeText(activity, activity.getString(R.string.osb_close_dialog_error), Toast.LENGTH_LONG).show(); Toast.makeText(activity, activity.getString(R.string.osb_close_dialog_error), Toast.LENGTH_LONG).show();
} }
@ -443,8 +444,8 @@ public class OsmBugsLayer implements OsmandMapLayer, ContextMenuLayer.IContextMe
@Override @Override
public OnClickListener getActionListener(List<String> actionsList, Object o) { public OnClickListener getActionListener(List<String> actionsList, Object o) {
final OpenStreetBug bug = (OpenStreetBug) o; final OpenStreetBug bug = (OpenStreetBug) o;
actionsList.add(view.getContext().getString(R.string.osb_comment_menu_item)); actionsList.add(activity.getString(R.string.osb_comment_menu_item));
actionsList.add(view.getContext().getString(R.string.osb_close_menu_item)); actionsList.add(activity.getString(R.string.osb_close_menu_item));
return new DialogInterface.OnClickListener() { return new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
@ -461,7 +462,7 @@ public class OsmBugsLayer implements OsmandMapLayer, ContextMenuLayer.IContextMe
@Override @Override
public String getObjectDescription(Object o) { public String getObjectDescription(Object o) {
if(o instanceof OpenStreetBug){ if(o instanceof OpenStreetBug){
return view.getContext().getString(R.string.osb_bug_name) + " : " + ((OpenStreetBug)o).getName(); //$NON-NLS-1$ return activity.getString(R.string.osb_bug_name) + " : " + ((OpenStreetBug)o).getName(); //$NON-NLS-1$
} }
return null; return null;
} }