This commit is contained in:
GaidamakUA 2015-11-12 11:14:28 +02:00
commit d8b8951ad1
21 changed files with 268 additions and 53 deletions

View file

@ -147,7 +147,13 @@ public class MapPoiTypes {
Map<String, PoiType> translation = new HashMap<String, PoiType>();
for(PoiCategory pc : categories) {
for(PoiType pt : pc.getPoiTypes()) {
if(pt.isReference() || pt.isNotEditableOsm()) {
if(pt.isReference() ) {
continue;
}
if(pt.getBaseLangType() != null) {
continue;
}
if(skipNonEditable && pt.isNotEditableOsm()) {
continue;
}
translation.put(pt.getKeyName().replace('_', ' ').toLowerCase(), pt);

View file

@ -100,9 +100,8 @@
</fileset>
</copy>
<sync todir="assets/help/">
<fileset dir="../../help/help">
<fileset dir="../../help/website/help">
<include name="*.html" />
<include name="images/**/*.png" />
</fileset>
</sync>
<copy todir="assets/help">

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="osb_author_or_password_not_specified">Моля, въведете потребителско име и парола за сайта на OSM</string>
<string name="clear_intermediate_points">Изчистване на междинните точки</string>
<string name="keep_intermediate_points">Запази междинните точки</string>
@ -197,7 +198,7 @@
<string name="map_widget_show_destination_arrow">Покажи посоката към крайната цел</string>
<string name="enable_plugin_monitoring_services">Включете добавката за проследяване за да ползвате запис на GPX или онлайн проследяване</string>
<string name="non_optimal_route_calculation">Изчисляване на вероятно не най-оптималния маршрут при дълги разстояния</string>
<string name="gps_not_available">Моля, включете GPS в настройки</string>
<string name="gps_not_available">Моля, включете GPS-а в настройките</string>
<string name="map_widget_monitoring_services">Услуги за записи</string>
<string name="no_route">Няма маршрут</string>
@ -1494,7 +1495,7 @@ OsmAnd е с отворен код и активно да се развива.
<string name="sleep_mode_stop_dialog">Прекъсване на фоновия режим GPS?</string>
<string name="save_track_to_gpx_globally">Записване на следата в GPX файл</string>
<string name="save_track_interval_globally">Интервал за запис</string>
<string name="gps_wake_up_timer">Интервал за събуждане на GPS</string>
<string name="gps_wake_up_timer">Интервал за задействане на GPS-a</string>
<string name="map_preferred_locale_descr">Предпочитан език за наименованията по картата (ако този език не е наличен, ще се имената ще се изписват на английски или на местния език)</string>
<string name="map_preferred_locale">Предпочитан език за картата</string>
<string name="live_monitoring_m">Онлайн следа (изисква се GPX)</string>
@ -1596,7 +1597,7 @@ OsmAnd е с отворен код и активно да се развива.
<string name="shared_string_search">Търсене</string>
<string name="shared_string_show_description">Покажи описанието</string>
<string name="shared_string_message">Съобщение</string>
<string name="agps_data_last_downloaded">A-GPS данни изтеглени преди: %1$s</string>
<string name="agps_data_last_downloaded">A-GPS последно изтеглени в: %1$s</string>
<string name="routing_attr_no_new_routing_name">Без ползване на алгоритми от v1.9</string>
<string name="routing_attr_no_new_routing_description">Да не се ползват алгоритми за маршрути въведени във версия 1.9</string>
<string name="rendering_attr_hideHouseNumbers_name">Скрий номерата на къщите</string>
@ -1968,4 +1969,56 @@ OsmAnd е с отворен код и активно да се развива.
<string name="poi_dialog_poi_type">Тип POI</string>
<string name="working_days">Работни дни</string>
<string name="favourites">Любими</string>
<string name="lang_mk">македонски</string>
<string name="lang_fy">фризки</string>
<string name="lang_als">албански</string>
<string name="read_more">Прочети повече</string>
<string name="whats_new">Какво е новото в</string>
<string name="rendering_attr_hideProposed_name">Скрий предложените обекти</string>
<string name="shared_string_update">Актуализация</string>
<string name="shared_string_upload">Качване</string>
<string name="osm_edit_created_poi">Създаден OSM POI</string>
<string name="osm_edit_created_bug">Създаден OSM бъг</string>
<string name="world_map_download_descr">Световната базова карта (покриваща целия свят в при малък мащаб) липсва или е остаряла. Моля, помислите за изтеглянето й .</string>
<string name="shared_string_qr_code">QR код</string>
<string name="map_downloaded">Картата е изтеглена</string>
<string name="map_downloaded_descr">Картата на %1$s беше изтеглена. Върнете се на картния изглед за да я ползвате.</string>
<string name="go_to_map">Преминете към картата</string>
<string name="simulate_initial_startup_descr">Установява маркер, който показва първо стартиране на приложението; всички други настройки остават непроменени</string>
<string name="simulate_initial_startup">Симулиране на първото стартиране на приложение</string>
<string name="share_geo">Гео:</string>
<string name="share_menu_location">Споделяне на местоположението</string>
<string name="shared_string_send">Изпрати</string>
<string name="favorite_category_dublicate_message">Съществува категория със същото име. Моля, посочете друго име.</string>
<string name="favorite_category_name">Име на категория</string>
<string name="favorite_category_add_new_title">Добавяне на нова категория</string>
<string name="regions">Региони</string>
<string name="region_maps">Карти на региони</string>
<string name="world_maps">Световни карти</string>
<string name="hillshade_layer_disabled">Релефът на местността е изключен</string>
<string name="srtm_plugin_disabled">Контурните линии са изключени</string>
<string name="favorite_category_add_new">Добавяне на нов</string>
<string name="favorite_category_select">Изберете категория</string>
<string name="default_speed_system_descr">Определяне на системата за измерване на скоростта</string>
<string name="default_speed_system">Измерване скоростта</string>
<string name="nm">nm</string>
<string name="si_nm">Морски мили</string>
<string name="si_kmh">Км в час</string>
<string name="si_mph">Мили в час</string>
<string name="si_m_s">Метра в секунда</string>
<string name="si_min_km">Минути на километър</string>
<string name="si_min_m">Минути на миля</string>
<string name="si_nm_h">Морски мили в час (възли)</string>
<string name="nm_h">nmh</string>
<string name="min_mile">мин/м</string>
<string name="map_legend">Легенда на картата</string>
<string name="contact_us">Свържете се с нас</string>
<string name="share_osm_edits_subject">OSM редакции, споделени чрез OsmAnd</string>
<string name="lang_nds">Долногермански езици</string>
<string name="min_km">мин/км</string>
<string name="m_s">м/сек</string>
<string name="shared_string_trip_recording">Записване на изминатия път</string>
<string name="shared_string_navigation">Навигация</string>
<string name="osmand_running_in_background">Работи във фонов режим</string>
<string name="favourites_edit_dialog_title">Предпочитана информация</string>
</resources>

View file

@ -2016,4 +2016,5 @@
<string name="lang_mk">Makedonisk</string>
<string name="lang_fy">Vestfrisisk</string>
<string name="lang_als">Albansk (Tosk)</string>
<string name="share_osm_edits_subject">OSM redigeringer deles via OsmAnd</string>
</resources>

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="regions">Regionen</string>
<string name="region_maps">Regionsweite Karten</string>
<string name="world_maps">Weltweite Karten</string>
@ -684,7 +685,7 @@
<string name="gps_provider">GPS</string>
<string name="int_seconds">Sekunden</string>
<string name="int_min">Min.</string>
<string name="background_service_provider_descr">Art der Hintergrund-Standortbestimmung</string>
<string name="background_service_provider_descr">Art der Standortbestimmung beim Hintergrunddienst</string>
<string name="background_service_provider">Standortbestimmung</string>
<string name="off_router_service_no_gps_available">Die Hintergrundnavigation erfordert aktiviertes GPS.</string>
<string name="hide_poi_filter">Filter verstecken</string>
@ -2078,4 +2079,60 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an
<string name="map_downloaded">Karte heruntergeladen</string>
<string name="map_downloaded_descr">Karte von %1$s wurde heruntergeladen. Gehen Sie zur Karte, um sie zu benutzen.</string>
<string name="go_to_map">Zur Karte gehen</string>
<string name="lang_nds">Plattdeutsch</string>
<string name="lang_mk">Mazedonisch</string>
<string name="read_more">Weiter lesen</string>
<string name="whats_new">Neuerungen in</string>
<string name="osm_edit_created_poi">OSM POI erstellt</string>
<string name="osm_edit_created_bug">OSM Note erstellt</string>
<string name="world_map_download_descr">Die Basis-Weltkarte (Abdeckung für den ganzen Planeten bei kleinen Zoomstufen) ist nicht vorhanden oder veraltet. Für eine korrekte Darstellung sollte die Basis-Weltkarte heruntergeladen werden.</string>
<string name="simulate_initial_startup_descr">Setzt das Flag zum erstmaligen App-Start. Alle anderen Einstellungen bleiben unverändert.</string>
<string name="simulate_initial_startup">Simuliere den ersten App-Start</string>
<string name="share_geo">geo:</string>
<string name="share_menu_location">Position teilen</string>
<string name="shared_string_send">Senden</string>
<string name="favorite_category_dublicate_message">Der eingegebene Kategorie-Name existiert bereits. Bitte einen anderen Namen eingeben.</string>
<string name="favorite_category_name">Kategorie-Name</string>
<string name="favorite_category_add_new_title">Neue Kategorie hinzufügen</string>
<string name="srtm_plugin_disabled">Höhenlinien deaktiviert</string>
<string name="favorite_category_select">Kategorie auswählen</string>
<string name="default_speed_system_descr">System zur Geschwindigkeitsmessung eingeben</string>
<string name="default_speed_system">Geschwindigkeitsmessung</string>
<string name="nm">nm</string>
<string name="nm_h">nmh</string>
<string name="min_mile">min/m</string>
<string name="min_km">min/km</string>
<string name="m_s">m/s</string>
<string name="shared_string_trip_recording">Streckenaufzeichnung</string>
<string name="osmand_running_in_background">Hintergrundbetrieb</string>
<string name="favourites_edit_dialog_title">Favoriten-Information</string>
<string name="simulate_your_location_stop_descr">Stoppen der Positions-Simulation</string>
<string name="simulate_your_location_descr">Simulieren durch eine berechnete Route oder einer aufgezeichneten GPX-Spur</string>
<string name="recent_places">Letzte Orte</string>
<string name="saved_at_time">Erfolgreich gespeichert unter: %1$s</string>
<string name="count_of_lines">Anzahl der Reihen</string>
<string name="buy">ERWERBEN</string>
<string name="later">Später</string>
<string name="downloads">Downloads</string>
<string name="application_dir_description">Bitte den Speicherort für heruntergeladene Karten wählen.</string>
<string name="new_version">Neue Version</string>
<string name="begin_with_osmand_menu_group">Erste Schritte in Osmand</string>
<string name="features_menu_group">Merkmale</string>
<string name="help_us_to_improve_menu_group">Hilf uns, Osmand weiter zu verbessern</string>
<string name="other_menu_group">Weitere</string>
<string name="plugins_menu_group">Plugins</string>
<string name="first_usage_item">Erste Benutzung</string>
<string name="first_usage_item_description">Wie Karten heruntergeladen und erste Einstellungen gewählt werden</string>
<string name="navigation_item_description">Navigation einstellen</string>
<string name="planning_trip_item">Eine Reise planen</string>
<string name="faq_item">FAQ</string>
<string name="faq_item_description">Häufige Fragen</string>
<string name="map_viewing_item">Kartenansicht</string>
<string name="search_on_the_map_item">Karten-Suche</string>
<string name="instalation_troubleshooting_item">Installation und Problembehebung</string>
<string name="techical_articles_item">Technische Themen</string>
<string name="versions_item">Versionen</string>
<string name="feedback">Feedback</string>
<string name="contact_us">Kontakt</string>
<string name="map_legend">Kartenlegende</string>
</resources>

View file

@ -2416,4 +2416,8 @@
<string name="poi_cargo_container">Cargamento: Contenedores</string>
<string name="poi_cargo_hgv">Cargamento: Vehículos pesados</string>
<string name="poi_fitness_station">Gimnasio exterior</string>
<string name="poi_hackerspace">Encuentro de hackers</string>
</resources>

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="rendering_attr_hideHouseNumbers_name">Ocultar números de casa</string>
<string name="copying_osmand_file_failed">Falló al copiar archivos</string>
@ -1831,7 +1832,7 @@
<string name="routing_attr_avoid_shuttle_train_description">Evite tomar trenes de enlace</string>
<string name="plugin_settings">Complementos</string>
<string name="tab_title_basic">Básico</string>
<string name="tab_title_advanced">Extendido</string>
<string name="tab_title_advanced">Avanzado</string>
<string name="building_number">Número de edificio</string>
<string name="next_proceed">Siguiente</string>
<string name="opening_at">Abren a las</string>
@ -1945,4 +1946,9 @@
<string name="read_more">Leer más</string>
<string name="whats_new">Novedades en</string>
<string name="share_osm_edits_subject">Compartir ediciones OSM mediante OsmAnd</string>
<string name="lang_nds">Bajo Alemán</string>
<string name="lang_mk">Macedonio</string>
<string name="lang_fy">Frisón</string>
<string name="lang_als">Albano (Tosk)</string>
</resources>

View file

@ -1535,7 +1535,7 @@
<string name="traffic_warning_stop">Señal de detención</string>
<string name="traffic_warning_speed_camera">Radar de velocidad</string>
<string name="local_index_description">Pulsa cualquier objeto para ver más detalles, mantén pulsado para desactivar o borrar. Datos en el dispositivo actualmente (%1$s libre):</string>
<string name="traffic_warning_calming">Reductores de velocidad</string>
<string name="traffic_warning_calming">Reductor de velocidad</string>
<string name="traffic_warning">Aviso de tráfico</string>
<string name="text_size_descr">Establece el tamaño del texto en el mapa.</string>
<string name="text_size">Tamaño de texto</string>
@ -1844,7 +1844,7 @@
<string name="routing_attr_avoid_shuttle_train_description">Evite tomar trenes de enlace</string>
<string name="plugin_settings">Complementos</string>
<string name="tab_title_basic">Básico</string>
<string name="tab_title_advanced">Extendido</string>
<string name="tab_title_advanced">Avanzado</string>
<string name="building_number">Número de edificio</string>
<string name="next_proceed">Siguiente</string>
<string name="opening_at">Abren a las</string>
@ -1962,4 +1962,5 @@
<string name="lang_mk">Macedonio</string>
<string name="lang_fy">Frisón</string>
<string name="lang_als">Albano (Tosk)</string>
<string name="share_osm_edits_subject">Ediciones OSM compartidas vía OsmAnd</string>
</resources>

View file

@ -1223,7 +1223,7 @@ Afghanistan, Albanie, Algérie, Allemagne, Andorre, Angola, Anguilla, Antigua-et
<string name="local_index_tile_data_name">Données de tuile : %1$s</string>
<string name="edit_tilesource_successfully">Le fournisseur de tuiles %1$s a été enregistré avec succès.</string>
<string name="edit_tilesource_elliptic_tile">Mercator elliptique</string>
<string name="edit_tilesource_choose_existing">Choisir existant…</string>
<string name="edit_tilesource_choose_existing">Sélectionner existant…</string>
<string name="maps_define_edit">Définir/Éditer…</string>
<string name="announce_gpx_waypoints">Points de passage GPX</string>
<string name="speak_descr">Annoncer les noms de rue, les avertissements (stops, ralentisseurs, radars), les limitations de vitesse</string>
@ -2089,5 +2089,5 @@ Afghanistan, Albanie, Algérie, Allemagne, Andorre, Angola, Anguilla, Antigua-et
<string name="lang_fy">Frison occidental</string>
<string name="lang_als">Tosque</string>
<string name="lang_nds">Bas allemand</string>
<string name="share_osm_edits_subject">Editions OSM partagées avec OsmAnd</string>
<string name="share_osm_edits_subject">Éditions OSM partagées grâce à OsmAnd</string>
</resources>

View file

@ -948,4 +948,76 @@
<string name="poi_wiki_lang_vo">Volapük wiki</string>
<string name="poi_wiki_lang_zh">Kínai wiki</string>
<string name="poi_icn_ref">Nemzetközi kerékpáros hálózati csomópont</string>
<string name="poi_ncn_ref">Országos kerékpáros hálózati csomópont</string>
<string name="poi_rcn_ref">Regionális kerékpáros hálózati csomópont</string>
<string name="poi_lcn_ref">Helyi kerékpáros hálózati csomópont</string>
<string name="poi_iwn_ref">Nemzetközi turistaút-hálózati csomópont</string>
<string name="poi_nwn_ref">Országos turistaút-hálózati csomópont</string>
<string name="poi_rwn_ref">Regionális turistaút-hálózati csomópont</string>
<string name="poi_lwn_ref">Helyi turistaút-hálózati csomópont</string>
<string name="poi_route_hiking_iwn_poi">Nemzetközi turistaút</string>
<string name="poi_route_hiking_nwn_poi">Országos turistaút</string>
<string name="poi_route_hiking_rwn_poi">Regionális turistaút</string>
<string name="poi_route_hiking_lwn_poi">Helyi turistaút</string>
<string name="poi_route_hiking_ref_poi">Turistaút azonosító</string>
<string name="poi_opening_hours">Nyitvatartás</string>
<string name="poi_collection_times">Ürítési idő</string>
<string name="poi_description">Leírás</string>
<string name="poi_phone">Telefon</string>
<string name="poi_website">Weboldal</string>
<string name="poi_email">Email</string>
<string name="poi_fax">Fax</string>
<string name="poi_facebook">Facebook</string>
<string name="poi_twitter">Twitter</string>
<string name="poi_skype">Skype</string>
<string name="poi_youtube">YouTube</string>
<string name="poi_instagram">Instagram</string>
<string name="poi_vk">VKontakte</string>
<string name="poi_google_plus">Google+</string>
<string name="poi_mobile">Mobiltelefon</string>
<string name="poi_service_times">Szolgáltatási idő</string>
<string name="poi_maxheight">Maximális magasság</string>
<string name="poi_maxweight">Maximális súly</string>
<string name="poi_height">Magasság</string>
<string name="poi_ele">Tengerszint feletti magasság</string>
<string name="poi_abandoned">Elhagyott</string>
<string name="poi_abandoned_poi">Elhagyott objektum</string>
<string name="poi_disused">Használaton kívüli</string>
<string name="poi_operator">Üzemeltető</string>
<string name="poi_brand">Márka</string>
<string name="poi_fee_yes">Fizetős</string>
<string name="poi_fee_no">Ingyenes</string>
<string name="poi_drinking_water_yes">Ivóvíz</string>
<string name="poi_drinking_water_no">Nem ivóvíz</string>
<string name="poi_supervised_yes">Felügyelt</string>
<string name="poi_supervised_no">Felügyelet nélküli</string>
<string name="poi_seasonal_yes">Időszakos</string>
<string name="poi_seasonal_no">Állandó</string>
<string name="poi_seasonal_dry_season">Száraz évszak</string>
<string name="poi_seasonal_wet_season">Nedves évszak</string>
<string name="poi_seasonal_spring">forrás</string>
<string name="poi_seasonal_summer">nyár</string>
<string name="poi_seasonal_autumn">eső</string>
<string name="poi_seasonal_winter">tél</string>
<string name="poi_crossing_traffic_signals">Jelzőlámpás</string>
<string name="poi_crossing_uncontrolled">Szabályozatlan</string>
<string name="poi_crossing_unmarked">Jelzetlen</string>
<string name="poi_start_date">Kezdő dátum</string>
<string name="poi_wheelchair">Kerekesszék</string>
<string name="poi_wheelchair_no">Kerekesszék: nem lehetséges</string>
<string name="poi_wheelchair_limited">Kerekesszék: korlátozott</string>
<string name="poi_wholesale">Nagykereskedés</string>
<string name="poi_access_private">Privát bemenet</string>
<string name="poi_access_no">Bemenni tilos</string>
<string name="poi_access_destination">Célforgalom</string>
<string name="poi_access_permissive">Engedélyköteles bemenet</string>
<string name="poi_access_customers">Vásárlók mehetnek be</string>
<string name="poi_access_delivery">Áruszállításra használható</string>
<string name="poi_access_agricultural">Mezőgazdasági bemenet</string>
</resources>

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="send_files_to_osm">GPX fájl küldése OSM-re?</string>
<string name="gpx_visibility_txt">Láthatóság</string>
<string name="gpx_tags_txt">Címkék</string>
@ -1992,4 +1993,9 @@
<string name="osm_edit_created_bug">Létrehozott OSM bug</string>
<string name="map_legend">Térkép jelkulcs</string>
<string name="favourites_edit_dialog_title">Kedvenc információk</string>
<string name="share_osm_edits_subject">OSM szerkesztés OsmAndból megosztva</string>
<string name="lang_nds">Alnémet</string>
<string name="lang_mk">Macedón</string>
<string name="lang_fy">Fríz</string>
<string name="lang_als">Albán (toszk)</string>
</resources>

View file

@ -2194,4 +2194,9 @@ Afghanistan, Albanie, Algerije, Andorra, Angola, Anguilla, Antigua en Barbuda, A
<string name="read_more">Meer lezen</string>
<string name="whats_new">Wat is nieuw in</string>
<string name="rendering_attr_hideProposed_name">Verberg voorgestelde objecten</string>
<string name="share_osm_edits_subject">Via OsmAnd gedeelde OSM-bewerkingen</string>
<string name="lang_nds">Nederduits</string>
<string name="lang_mk">Macedonisch</string>
<string name="lang_fy">Fries</string>
<string name="lang_als">Toskisch (Albanees)</string>
</resources>

View file

@ -1988,4 +1988,5 @@
<string name="lang_mk">Matzèdone</string>
<string name="lang_fy">Frisone otzidentale</string>
<string name="lang_als">Albanesu (Tosk)</string>
<string name="share_osm_edits_subject">Modìficas Osm cumpartzidas pro mèdiu de OsmAnd</string>
</resources>

View file

@ -1974,4 +1974,5 @@
<string name="lang_mk">馬其頓</string>
<string name="lang_fy">菲士蘭</string>
<string name="lang_als">阿爾巴尼亞 (Tosk)</string>
<string name="share_osm_edits_subject">透過 OsmAnd 共用編輯 Osm</string>
</resources>

View file

@ -1,6 +1,8 @@
package net.osmand.plus;
import gnu.trove.list.array.TIntArrayList;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
@ -553,6 +555,7 @@ public class GPXUtilities {
public List<Track> tracks = new ArrayList<Track>();
public List<WptPt> points = new ArrayList<WptPt>();
public List<Route> routes = new ArrayList<Route>();
public String warning = null;
public String path = "";
public boolean showCurrentTrack;

View file

@ -296,10 +296,6 @@ public class IntermediatePointsDialog {
app.getTargetPointsHelper().removeWayPoint(cnt == 0, i);
}
}
// FIXME delete location when point is removed
// if(mapActivity instanceof MapActivity) {
// ((MapActivity) mapActivity).getMapLayers().getContextMenuLayer().setLocation(null, "");
// }
}
}
}

View file

@ -144,23 +144,30 @@ public class MapActivityActions implements DialogProvider {
builder.create().show();
}
public void directionTo(double latitude, double longitude) {
public void directionTo(double latitude, double longitude, PointDescription pd) {
final TargetPointsHelper targets = getMyApplication().getTargetPointsHelper();
targets.navigateToPoint(new LatLon(latitude, longitude), true, -1, null);
targets.navigateToPoint(new LatLon(latitude, longitude), true, -1, pd);
enterRoutePlanningMode(null, null, false);
}
public void addAsWaypoint(double latitude, double longitude) {
public void addAsWaypoint(double latitude, double longitude, PointDescription pd) {
TargetPointsHelper targets = getMyApplication().getTargetPointsHelper();
boolean destination = (targets.getPointToNavigate() == null);
targets.navigateToPoint(new LatLon(latitude, longitude), true,
destination ? -1 : targets.getIntermediatePoints().size(),
mapActivity.getContextMenu().getPointDescription());
pd);
openIntermediateEditPointsDialog();
}
public void addAsTarget(double latitude, double longitude, PointDescription pd) {
TargetPointsHelper targets = getMyApplication().getTargetPointsHelper();
targets.navigateToPoint(new LatLon(latitude, longitude), true, -1,
pd);
openIntermediateEditPointsDialog();
}
public void editWaypoints() {
openIntermediateEditPointsDialog();
}

View file

@ -351,7 +351,8 @@ public class MapContextMenu extends MenuTitleController {
if (pointDescription.isDestination()) {
mapActivity.getMapActions().editWaypoints();
} else {
mapActivity.getMapActions().addAsWaypoint(latLon.getLatitude(), latLon.getLongitude());
mapActivity.getMapActions().addAsTarget(latLon.getLatitude(), latLon.getLongitude(),
pointDescription);
}
close();
}

View file

@ -5,6 +5,7 @@ import net.osmand.data.Amenity;
import net.osmand.osm.PoiType;
import net.osmand.osm.edit.Node;
import net.osmand.osm.edit.OSMSettings;
import net.osmand.osm.edit.OSMSettings.OSMTagKey;
import net.osmand.util.Algorithms;
import org.apache.commons.logging.Log;
@ -20,20 +21,31 @@ public class EditPoiData {
private Set<TagsChangedListener> mListeners = new HashSet<>();
private LinkedHashMap<String, String > tagValues = new LinkedHashMap<String, String>();
private boolean isInEdit = false;
private Node entity;
public final Amenity amenity;
public static final String POI_TYPE_TAG = "poi_type_tag";
private boolean hasChangesBeenMade = false;
public EditPoiData(Amenity amenity, Node node, Map<String, PoiType> allTranslatedSubTypes) {
this.amenity = amenity;
entity = node;
initTags(node, allTranslatedSubTypes);
}
public Node getEntity() {
return entity;
}
public String getTag(String key) {
return tagValues.get(key);
}
public void updateTags(Map<String, String> mp) {
this.tagValues.clear();
this.tagValues.putAll(mp);
}
private void tryAddTag(String key, String value) {
if (!Algorithms.isEmpty(value)) {
tagValues.put(key, value);
@ -42,18 +54,6 @@ public class EditPoiData {
private void initTags(Node node, Map<String, PoiType> allTranslatedSubTypes) {
checkNotInEdit();
// tryAddTag(OSMSettings.OSMTagKey.ADDR_STREET.getValue(),
// node.getTag(OSMSettings.OSMTagKey.ADDR_STREET));
// tryAddTag(OSMSettings.OSMTagKey.ADDR_HOUSE_NUMBER.getValue(),
// node.getTag(OSMSettings.OSMTagKey.ADDR_HOUSE_NUMBER));
// should not be used here should be done in public Node loadNode(Amenity n) {
// tryAddTag(OSMSettings.OSMTagKey.PHONE.getValue(),
// amenity.getPhone());
// tryAddTag(OSMSettings.OSMTagKey.WEBSITE.getValue(),
// amenity.getSite());
// for (String tag : amenity.getAdditionalInfo().keySet()) {
// tryAddTag(tag, amenity.getAdditionalInfo(tag));
// }
for (String s : node.getTagKeySet()) {
tryAddTag(s, node.getTag(s));
}
@ -146,4 +146,5 @@ public class EditPoiData {
public boolean hasChangesBeenMade() {
return hasChangesBeenMade;
}
}

View file

@ -94,7 +94,6 @@ public class EditPoiDialogFragment extends DialogFragment {
private EditPoiData editPoiData;
private ViewPager viewPager;
private AutoCompleteTextView poiTypeEditText;
private Node node;
private Map<String, PoiType> allTranslatedSubTypes;
private OpenstreetmapUtil mOpenstreetmapUtil;
@ -111,7 +110,7 @@ public class EditPoiDialogFragment extends DialogFragment {
mOpenstreetmapUtil = new OpenstreetmapRemoteUtil(activity);
}
node = (Node) getArguments().getSerializable(KEY_AMENITY_NODE);
Node node = (Node) getArguments().getSerializable(KEY_AMENITY_NODE);
allTranslatedSubTypes = getMyApplication().getPoiTypes().getAllTranslatedNames(true);
Amenity amenity = (Amenity) getArguments().getSerializable(KEY_AMENITY);
@ -241,7 +240,7 @@ public class EditPoiDialogFragment extends DialogFragment {
}
}
});
poiNameEditText.setText(node.getTag(OSMSettings.OSMTagKey.NAME));
poiNameEditText.setText(editPoiData.getTag(OSMSettings.OSMTagKey.NAME.getValue()));
poiTypeTextInputLayout = (TextInputLayout) view.findViewById(R.id.poiTypeTextInputLayout);
poiTypeEditText = (AutoCompleteTextView) view.findViewById(R.id.poiTypeEditText);
poiTypeEditText.addTextChangedListener(new TextWatcher() {
@ -309,6 +308,8 @@ public class EditPoiDialogFragment extends DialogFragment {
}
private void save() {
Node original = editPoiData.getEntity();
Node node = new Node(original.getLatitude(), original.getLongitude(), original.getId());
OsmPoint.Action action = node.getId() == -1 ? OsmPoint.Action.CREATE : OsmPoint.Action.MODIFY;
for (Map.Entry<String, String> tag : editPoiData.getTagValues().entrySet()) {
if (tag.getKey().equals(EditPoiData.POI_TYPE_TAG)) {
@ -320,15 +321,10 @@ public class EditPoiDialogFragment extends DialogFragment {
}
} else {
node.putTag(editPoiData.amenity.getType().getDefaultTag(), tag.getValue());
}
// } else if (tag.tag.equals(OSMSettings.OSMTagKey.DESCRIPTION.getValue())) {
// description = tag.value;
} else {
if (tag.getKey().length() > 0) {
} else if (!Algorithms.isEmpty(tag.getKey()) && !Algorithms.isEmpty(tag.getValue())) {
node.putTag(tag.getKey(), tag.getValue());
} else {
node.removeTag(tag.getKey());
}
}
}
commitNode(action, node, mOpenstreetmapUtil.getEntityInfo(),

View file

@ -26,7 +26,6 @@ public class PoiSubTypeDialogFragment extends DialogFragment {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
final Amenity a = (Amenity) getArguments().getSerializable(KEY_AMENITY);
final Map<String, PoiType> allTranslatedNames = poiTypes.getAllTranslatedNames(a.getType(), true);
// (=^.^=)
Set<String> strings = allTranslatedNames.keySet();
final String[] subCats = strings.toArray(new String[strings.size()]);
builder.setItems(subCats, new DialogInterface.OnClickListener() {