Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b7f8ac96c4
43 changed files with 229 additions and 97 deletions
|
@ -108,6 +108,24 @@ public class MapPoiTypes {
|
|||
return null;
|
||||
}
|
||||
|
||||
public AbstractPoiType getAnyPoiTypeByKey(String name) {
|
||||
for(PoiCategory pc : categories) {
|
||||
if(pc.getKeyName().equals(name)) {
|
||||
return pc;
|
||||
}
|
||||
for(PoiFilter pf : pc.getPoiFilters()) {
|
||||
if(pf.getKeyName().equals(name)) {
|
||||
return pf;
|
||||
}
|
||||
}
|
||||
PoiType pt = pc.getPoiTypeByKeyName(name);
|
||||
if(pt != null && !pt.isReference()) {
|
||||
return pt;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Map<String, PoiType> getAllTranslatedNames() {
|
||||
Map<String, PoiType> translation = new TreeMap<String, PoiType>();
|
||||
for(PoiCategory pc : categories) {
|
||||
|
@ -208,6 +226,7 @@ public class MapPoiTypes {
|
|||
parser.setInput(is, "UTF-8");
|
||||
PoiCategory lastCategory = null;
|
||||
PoiFilter lastFilter = null;
|
||||
PoiType lastType = null;
|
||||
while ((tok = parser.next()) != XmlPullParser.END_DOCUMENT) {
|
||||
if (tok == XmlPullParser.START_TAG) {
|
||||
String name = parser.getName();
|
||||
|
@ -230,6 +249,16 @@ public class MapPoiTypes {
|
|||
lastFilter.addPoiType(tp);
|
||||
}
|
||||
lastCategory.addPoiType(tp);
|
||||
} else if(name.equals("poi_additional")){
|
||||
PoiType tp = new PoiType(this,
|
||||
lastCategory, parser.getAttributeValue("","name"));
|
||||
tp.setOsmTag(parser.getAttributeValue("","tag"));
|
||||
tp.setOsmValue(parser.getAttributeValue("","value"));
|
||||
tp.setOsmTag2(parser.getAttributeValue("","tag2"));
|
||||
tp.setOsmValue2(parser.getAttributeValue("","value2"));
|
||||
if(lastType != null) {
|
||||
lastType.addPoiAdditional(tp);
|
||||
}
|
||||
} else if(name.equals("poi_type")){
|
||||
PoiType tp = new PoiType(this,
|
||||
lastCategory, parser.getAttributeValue("","name"));
|
||||
|
@ -237,7 +266,7 @@ public class MapPoiTypes {
|
|||
tp.setOsmValue(parser.getAttributeValue("","value"));
|
||||
tp.setOsmTag2(parser.getAttributeValue("","tag2"));
|
||||
tp.setOsmValue2(parser.getAttributeValue("","value2"));
|
||||
|
||||
lastType = tp;
|
||||
if(lastFilter != null) {
|
||||
lastFilter.addPoiType(tp);
|
||||
}
|
||||
|
@ -247,7 +276,9 @@ public class MapPoiTypes {
|
|||
String name = parser.getName();
|
||||
if (name.equals("poi_filter")) {
|
||||
lastFilter = null;
|
||||
}
|
||||
} else if (name.equals("poi_type")) {
|
||||
lastType = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
log.info("Time to init poi types" + (System.currentTimeMillis() - time)); //$NON-NLS-1$
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
package net.osmand.osm;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class PoiType extends AbstractPoiType {
|
||||
|
@ -11,6 +14,7 @@ public class PoiType extends AbstractPoiType {
|
|||
private String osmTag2;
|
||||
private String osmValue;
|
||||
private String osmValue2;
|
||||
private List<PoiType> poiAdditionals = null;
|
||||
|
||||
public PoiType(MapPoiTypes poiTypes, PoiCategory category, String name) {
|
||||
super(name, poiTypes);
|
||||
|
@ -77,6 +81,20 @@ public class PoiType extends AbstractPoiType {
|
|||
return category;
|
||||
}
|
||||
|
||||
public void addPoiAdditional(PoiType tp) {
|
||||
if(poiAdditionals == null) {
|
||||
poiAdditionals = new ArrayList<PoiType>();
|
||||
}
|
||||
poiAdditionals.add(tp);
|
||||
}
|
||||
|
||||
public List<PoiType> getPoiAdditionals() {
|
||||
if(poiAdditionals == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return poiAdditionals;
|
||||
}
|
||||
|
||||
public Map<PoiCategory, LinkedHashSet<String>> putTypes(Map<PoiCategory, LinkedHashSet<String>> acceptedTypes) {
|
||||
PoiType rt = getReferenceType();
|
||||
PoiType poiType = rt != null ? rt : this;
|
||||
|
@ -90,4 +108,6 @@ public class PoiType extends AbstractPoiType {
|
|||
return acceptedTypes;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
|
||||
<ImageButton
|
||||
android:id="@+id/all"
|
||||
android:contentDescription="@string/flat_list_waypoints"
|
||||
android:contentDescription="@string/shared_string_all"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
|
|
|
@ -135,7 +135,7 @@
|
|||
<string name="duration">Praciahlaść</string>
|
||||
<string name="distance">Adliehlaść</string>
|
||||
<string name="index_tours">Pajezdkі</string>
|
||||
<string name="flat_list_waypoints">Usie</string>
|
||||
<string name="shared_string_all">Usie</string>
|
||||
<string name="waypoints">Kropkі šliachu</string>
|
||||
<string name="targets">Celі</string>
|
||||
<string name="announce_gpx_waypoints">Ahalošvać maršrutnyja punkty GPX</string>
|
||||
|
|
|
@ -1673,7 +1673,7 @@
|
|||
<string name="speak_favorites">Абвяшчаць выбраныя паблізу</string>
|
||||
<string name="speak_poi">Абвяшчаць навакольныя POI</string>
|
||||
<string name="targets">Цэлі</string>
|
||||
<string name="flat_list_waypoints">Усе</string>
|
||||
<string name="shared_string_all">Усе</string>
|
||||
<string name="index_tours">Паездкі</string>
|
||||
<string name="record_plugin_description">"Модуль актывуе функцыі для запісу і захоўваньня вашых сьлядоў уручную націскам на віджэт запісу GPX на экране мапы, або таксама аўтаматычна запісвае ўсе вашы маршруты навігацыі ў файл GPX.\n\nЗапісанымі сьлядамі можна падзяліцца з вашымі сябрамі або выкарыстоўваць іх для адсылкі ў OSM. Спартсмэны могуць выкарыстоўваць запісаныя сьляды для кантролю за трэніроўкамі. Некаторы базавы аналіз трэкаў можа быць выкананы непасрэдна ў OsmAnd, напрыклад, час праходжаньня кругу, сярэдняя хуткасьць і г.д., трэкі, вядома, пазней таксама могуць быць прааналізаваны ў спецыяльных інструмэнтах аналізу іншых вытворцаў. "</string>
|
||||
<string name="record_plugin_name">Запіс падарожжа</string>
|
||||
|
|
|
@ -1653,7 +1653,7 @@ OsmAnd е с отворен код и активно да се развива.
|
|||
<string name="duration">Продължителност</string>
|
||||
<string name="distance">Разстояние</string>
|
||||
<string name="index_tours">Пътувания</string>
|
||||
<string name="flat_list_waypoints">Всички</string>
|
||||
<string name="shared_string_all">Всички</string>
|
||||
<string name="waypoints">Точки</string>
|
||||
<string name="targets">Дестинации</string>
|
||||
<string name="way_alarms">Предупреждения</string>
|
||||
|
|
|
@ -1756,7 +1756,7 @@
|
|||
<string name="speak_favorites">Indica els preferits propers</string>
|
||||
<string name="speak_poi">Indica els PDI propers</string>
|
||||
<string name="index_tours">Itineraris</string>
|
||||
<string name="flat_list_waypoints">Totes</string>
|
||||
<string name="shared_string_all">Totes</string>
|
||||
<string name="record_plugin_description">"Aquest connector activa la funcionalitat d\'enregistrar i desar els vostres trajectes, sigui prement sobre la pantalla del mapa el giny de gravació GPX, o sigui desant-los tots en un arxiu GPX automàticament.\n\nLes rutes enregistrades es poden compartir amb els vostres amics o aportar-les per ser utilitzades a OSM. Els atletes poden utilitzar els seus registres per monitoritzar els seus entrenaments. Es pot fer una anàlisi bàsica de les rutes directament a OsmAnd com la durada de cada volta, velocitat mitjana, etc., i, per descomptat, es poden analitzar amb eines especialitzades de tercers. "</string>
|
||||
<string name="record_plugin_name">Enregistrament de trajectes</string>
|
||||
<string name="int_hour">h</string>
|
||||
|
|
|
@ -1708,7 +1708,7 @@ s často kladenými otázkami.</string>
|
|||
<string name="duration">Trvání</string>
|
||||
<string name="distance">Vzdálenost</string>
|
||||
<string name="index_tours">Cesty</string>
|
||||
<string name="flat_list_waypoints">Všechny</string>
|
||||
<string name="shared_string_all">Všechny</string>
|
||||
<string name="save_track_to_gpx_globally">"Ukládat trasu do GPX souboru"</string>
|
||||
<string name="waypoints">Body na trase</string>
|
||||
<string name="targets">Cíle</string>
|
||||
|
|
|
@ -1719,7 +1719,7 @@
|
|||
<string name="way_alarms">Trafikadvarsler</string>
|
||||
<string name="speak_favorites">Favoritter i nærheden</string>
|
||||
<string name="speak_poi">Interessepunkt (IP) i nærheden</string>
|
||||
<string name="flat_list_waypoints">Alle</string>
|
||||
<string name="shared_string_all">Alle</string>
|
||||
<string name="index_tours">Ture</string>
|
||||
<string name="distance">Afstand</string>
|
||||
<string name="duration">Varighed</string>
|
||||
|
|
|
@ -1938,7 +1938,7 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an
|
|||
<string name="duration">Dauer</string>
|
||||
<string name="distance">Distanz</string>
|
||||
<string name="index_tours">Touren</string>
|
||||
<string name="flat_list_waypoints">Alle</string>
|
||||
<string name="shared_string_all">Alle</string>
|
||||
<string name="waypoints">Wegpunkte</string>
|
||||
<string name="targets">Ziele</string>
|
||||
<string name="way_alarms">Verkehrswarnungen</string>
|
||||
|
|
|
@ -1561,7 +1561,7 @@
|
|||
<string name="gpx_monitoring_stop">Παύση καταγραφής GPX</string>
|
||||
<string name="gpx_start_new_segment">Έναρξη νέου τμήματος</string>
|
||||
<string name="osmo_settings">Παρακολούθηση OsMo</string>
|
||||
<string name="flat_list_waypoints">Όλα</string>
|
||||
<string name="shared_string_all">Όλα</string>
|
||||
<string name="targets">Προορισμοί</string>
|
||||
<string name="way_alarms">Προειδοποιήσεις κυκλοφορίας</string>
|
||||
<string name="speak_favorites">Ανακοίνωση κοντινών Αγαπημένων</string>
|
||||
|
|
|
@ -1784,7 +1784,7 @@
|
|||
<string name="way_alarms">Advertencias de tráfico</string>
|
||||
<string name="speak_favorites">Anunciar favoritos cercanos</string>
|
||||
<string name="speak_poi">Anunciar PDI cercano</string>
|
||||
<string name="flat_list_waypoints">Todos</string>
|
||||
<string name="shared_string_all">Todos</string>
|
||||
<string name="index_tours">Excursiones</string>
|
||||
<string name="int_hour">h</string>
|
||||
<string name="duration">Duración</string>
|
||||
|
|
|
@ -1903,7 +1903,7 @@ OsmAnd منبع باز است و فعالانه در حال توسعه است.
|
|||
<string name="duration">مدت زمان</string>
|
||||
<string name="distance">فاصله</string>
|
||||
<string name="index_tours">سفرها</string>
|
||||
<string name="flat_list_waypoints">همه</string>
|
||||
<string name="shared_string_all">همه</string>
|
||||
<string name="waypoints">نقاط بین راهی</string>
|
||||
<string name="targets">مقاصد</string>
|
||||
<string name="way_alarms">موانع ترافیکی</string>
|
||||
|
|
|
@ -1790,7 +1790,7 @@ Afghanistan, Albanie, Algérie, Allemagne, Andorre, Angola, Anguilla, Antigua-et
|
|||
<string name="way_alarms">Alertes de circulation</string>
|
||||
<string name="speak_favorites">Annoncer les favoris proches</string>
|
||||
<string name="speak_poi">Annoncer les points d\'intérêt proches</string>
|
||||
<string name="flat_list_waypoints">Tous</string>
|
||||
<string name="shared_string_all">Tous</string>
|
||||
<string name="index_tours">Tours</string>
|
||||
<string name="record_plugin_description">"Ce greffon permet d\'enregistrer vos itinéraires au format GPX : soit automatiquement soit grâce à un bouton supplémentaire affiché sur la carte.\n\nLes traces ainsi enregistrées peuvent être partagées avec vos amis ou utilisées pour contribuer à OSM. Les sportifs peuvent utiliser ces enregistrements pour leurs entraînements. Certaines analyses des traces peuvent être réalisées directement dans OmsAnd (comme la vitesse moyenne, la durée de l\'itinéraire ...). Enfin les fichiers GPX locaux peuvent être exportés pour être utilisés par d\'autres applications. "</string>
|
||||
<string name="record_plugin_name">Enregistrement d\'itinéraire</string>
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
<string name="duration">Duración</string>
|
||||
<string name="distance">Distancia</string>
|
||||
<string name="index_tours">Visitas</string>
|
||||
<string name="flat_list_waypoints">Todo</string>
|
||||
<string name="shared_string_all">Todo</string>
|
||||
<string name="waypoints">Puntos de pasaxe</string>
|
||||
<string name="targets">Destinos</string>
|
||||
<string name="announce_gpx_waypoints">Anunciar os puntos de pasaxe do GPX</string>
|
||||
|
|
|
@ -1195,7 +1195,7 @@
|
|||
<string name="save_track_to_gpx_globally">Spremi rutu kao GPX trag</string>
|
||||
<string name="duration">Trajanje</string>
|
||||
<string name="distance">Udaljenost</string>
|
||||
<string name="flat_list_waypoints">Sve</string>
|
||||
<string name="shared_string_all">Sve</string>
|
||||
<string name="targets">Destinacije</string>
|
||||
<string name="way_alarms">Prometna upozorenja</string>
|
||||
<string name="speak_favorites">Najavi favorite u blizini</string>
|
||||
|
|
|
@ -1695,7 +1695,7 @@
|
|||
<string name="rendering_attr_osmcTraces_description">OSMC stílusú túrajelzések megjelenítése</string>
|
||||
|
||||
<string name="index_tours">Túrák</string>
|
||||
<string name="flat_list_waypoints">Összes</string>
|
||||
<string name="shared_string_all">Összes</string>
|
||||
<string name="waypoints">Útpontok</string>
|
||||
<string name="targets">Úti célok</string>
|
||||
<string name="way_alarms">Forgalmi figyelmeztetések</string>
|
||||
|
|
|
@ -1893,7 +1893,7 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz
|
|||
<string name="speak_favorites">Annuncia i preferiti nelle vicinanze</string>
|
||||
<string name="speak_poi">Annuncia PDI nelle vicinanze</string>
|
||||
<string name="index_tours">Itinerari</string>
|
||||
<string name="flat_list_waypoints">Tutto</string>
|
||||
<string name="shared_string_all">Tutto</string>
|
||||
<string name="record_plugin_description">"Questo componente aggiuntivo attiva la funzionalità di registrazione delle tue tracce o manualmente attraverso il pulsante dedicato nello schermo della mappa oppure automaticamente tenendo traccia di tutti i tuoi spostamenti in un file GPX.\n\nLe tracce registrate possono essere condivise con i tuoi amici o essere usate per chi contribuire a OSM. Gli atleti possono utilizzate le tracce registrate per monitorare i loro allenamenti. Alcuni analisi di base possono essere fatte direttamente in OsmAnd, come il tempo sul giro, la velocità media ecc., le tracce naturalmente possono essere in seguito analizzate con strumenti di analisi esterni. "</string>
|
||||
<string name="record_plugin_name">Registrazione viaggio</string>
|
||||
<string name="int_hour">h</string>
|
||||
|
|
|
@ -1793,7 +1793,7 @@ POIの更新は利用できません</string>
|
|||
|
||||
<string name="route_descr_destination">目的地</string>
|
||||
<string name="index_tours">旅行</string>
|
||||
<string name="flat_list_waypoints">全て</string>
|
||||
<string name="shared_string_all">全て</string>
|
||||
<string name="waypoints">経由地点</string>
|
||||
<string name="targets">目的地</string>
|
||||
<string name="way_alarms">交通警告</string>
|
||||
|
|
|
@ -1942,7 +1942,7 @@
|
|||
<string name="duration">경과시간</string>
|
||||
<string name="distance">거리</string>
|
||||
<string name="index_tours">여행</string>
|
||||
<string name="flat_list_waypoints">모두</string>
|
||||
<string name="shared_string_all">모두</string>
|
||||
<string name="waypoints">경유지</string>
|
||||
<string name="targets">도착지</string>
|
||||
<string name="way_alarms">교통 경고</string>
|
||||
|
|
|
@ -1774,7 +1774,7 @@
|
|||
<string name="shared_string_more">Dar…</string>
|
||||
<string name="download_additional_maps">Atsiųsti trūkstamus žemėlapius %1$s (%2$d MB)?</string>
|
||||
<string name="index_tours">Turai</string>
|
||||
<string name="flat_list_waypoints">Visi</string>
|
||||
<string name="shared_string_all">Visi</string>
|
||||
<string name="targets">Tikslai</string>
|
||||
<string name="waypoints">Tarpiniai taškai</string>
|
||||
<string name="way_alarms">Eismo perspėjimai</string>
|
||||
|
|
|
@ -1782,7 +1782,7 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A
|
|||
<string name="duration">Laiks</string>
|
||||
<string name="distance">Attālums</string>
|
||||
<string name="index_tours">Braucieni</string>
|
||||
<string name="flat_list_waypoints">Visi</string>
|
||||
<string name="shared_string_all">Visi</string>
|
||||
<string name="waypoints">Ceļapunkti</string>
|
||||
<string name="targets">Galamērķi</string>
|
||||
<string name="rendering_value_browse_map_name">Atvērt karti</string>
|
||||
|
|
|
@ -823,7 +823,7 @@
|
|||
<string name="duration">Varighet</string>
|
||||
<string name="distance">Avstand</string>
|
||||
<string name="index_tours">Turer</string>
|
||||
<string name="flat_list_waypoints">Alle</string>
|
||||
<string name="shared_string_all">Alle</string>
|
||||
<string name="shared_string_more">Mer…</string>
|
||||
<string name="rendering_value_browse_map_name">Se gjennom kart</string>
|
||||
<string name="rendering_attr_coloredBuildings_name">Fargekod bygninger etter type</string>
|
||||
|
|
|
@ -1889,7 +1889,7 @@ Afghanistan, Albanie, Algerije, Andorra, Angola, Anguilla, Antigua en Barbuda, A
|
|||
<string name="way_alarms">Filemeldingen</string>
|
||||
<string name="speak_favorites">Meld favorieten in de buurt</string>
|
||||
<string name="speak_poi">Meld POI in de buurt</string>
|
||||
<string name="flat_list_waypoints">Alle</string>
|
||||
<string name="shared_string_all">Alle</string>
|
||||
<string name="index_tours">Reizen</string>
|
||||
<string name="record_plugin_name">Route opname</string>
|
||||
<string name="int_hour">u.</string>
|
||||
|
|
|
@ -1884,7 +1884,7 @@ Afganistan, Afryka Południowa, Albania, Algieria, Andora, Angola, Anguilla, Ant
|
|||
<string name="duration">Czas trwania</string>
|
||||
<string name="distance">Odległość</string>
|
||||
<string name="index_tours">Wycieczki</string>
|
||||
<string name="flat_list_waypoints">Wszystkie</string>
|
||||
<string name="shared_string_all">Wszystkie</string>
|
||||
<string name="waypoints">Punkty trasy</string>
|
||||
<string name="targets">Kierunki</string>
|
||||
<string name="way_alarms">Ostrzeżenia ruchu drogowego</string>
|
||||
|
|
|
@ -1361,7 +1361,7 @@
|
|||
<string name="int_hour">h</string>
|
||||
<string name="duration">Durată</string>
|
||||
<string name="distance">Distanță</string>
|
||||
<string name="flat_list_waypoints">Toate</string>
|
||||
<string name="shared_string_all">Toate</string>
|
||||
<string name="waypoints">Puncte de referință</string>
|
||||
<string name="targets">Destinații</string>
|
||||
<string name="download_additional_maps">Descarcă hărțile lipsă %1$s (%2$d MB)?</string>
|
||||
|
|
|
@ -1705,7 +1705,7 @@
|
|||
<string name="speak_favorites">Объявлять близлежащие избранные</string>
|
||||
<string name="speak_poi">Объявлять близлежащие POI</string>
|
||||
<string name="index_tours">Туры</string>
|
||||
<string name="flat_list_waypoints">Все</string>
|
||||
<string name="shared_string_all">Все</string>
|
||||
<string name="distance">Расстояние</string>
|
||||
<string name="gpx_info_subtracks">"Подтрек: %1$s "</string>
|
||||
<string name="route_descr_destination">Пункт назначения</string>
|
||||
|
|
|
@ -1714,7 +1714,7 @@
|
|||
<string name="way_alarms">Avisos de tràficu</string>
|
||||
<string name="speak_favorites">Annùntzia sos Prefèrridos a curtzu</string>
|
||||
<string name="speak_poi">Annùntzia PDI a curtzu</string>
|
||||
<string name="flat_list_waypoints">Totus</string>
|
||||
<string name="shared_string_all">Totus</string>
|
||||
<string name="index_tours">Itineràrios</string>
|
||||
<string name="record_plugin_description">"Custu plugin ativat sa funtzionalidade de registratzione de sas rastas tuas carcande su pursante in s’ischermu de sa mapa e ammustrat sas impostaduras pro sa registratzione de sos biàgios tuos in documentos GPX localmente o in lìnia impreande unu servìtziu web.
|
||||
\n\nSas rastas registradas podent èssere cumpartzida cun sos amigos tuos o èssere impreadas pro cuntribuire a OSM. Sos atletas podent impreare sas rastas pro compidare sos allenamentos issoro. Carchi anàlisi de base podet èssere fata deretamente in OsmAnd, comente tempus de giru, lestresa mèdia etc., e sas rastas podent, est craru, èssere analizadas fintzas prus a tardu cun ainas estèrnas de anàlisi. "</string>
|
||||
|
|
|
@ -1867,7 +1867,7 @@ Afganistan, Albánsko, Alžírsko, Andora, Angola, Anguilla, Antigua a Barbuda,
|
|||
<string name="way_alarms">Dopravné varovania</string>
|
||||
<string name="speak_favorites">Oznamovať blízke obľúbené body</string>
|
||||
<string name="speak_poi">Oznamovať blízke body záujmu</string>
|
||||
<string name="flat_list_waypoints">Všetky</string>
|
||||
<string name="shared_string_all">Všetky</string>
|
||||
<string name="index_tours">Výlety</string>
|
||||
<string name="record_plugin_description">"Tento modul zapne funkciu nahratia a uloženia vašich stôp stlačením tlačidla nahrávania GPX na mape. Taktiež umožňuje nastaviť automatické zaznamenávanie navigačných trás do GPX súboru.\n\nZaznamenané stopy môžete zdieľať s priateľmi alebo odoslať ako príspevok do OSM. Atléti môžu použiť záznamy na sledovanie svojich tréningov. Základná analýza môže byť vykonaná už priamo v OsmAnd, napr. trvanie stopy, priemerná rýchlosť. Stopy môžu následne skúmať ďalšie špecializované programy. "</string>
|
||||
<string name="record_plugin_name">Zaznamenávanie výletov</string>
|
||||
|
|
|
@ -1857,7 +1857,7 @@ Seznam držav (praktično ves svet!): Afganistan, Albanija, Alžirija, Andora, A
|
|||
<string name="int_hour">ur</string>
|
||||
<string name="duration">Trajanje</string>
|
||||
<string name="distance">Razdalja</string>
|
||||
<string name="flat_list_waypoints">Vse</string>
|
||||
<string name="shared_string_all">Vse</string>
|
||||
<string name="targets">Cilji</string>
|
||||
<string name="confirm_every_run">Vsakič vprašaj</string>
|
||||
<string name="save_global_track_interval">Splošni interval beleženja</string>
|
||||
|
|
|
@ -1597,7 +1597,7 @@
|
|||
<string name="speak_favorites">Meddela om närbelägna favoriter</string>
|
||||
<string name="speak_poi">Meddela om närbelägna intresssepunkter</string>
|
||||
<string name="index_tours">Rundturer</string>
|
||||
<string name="flat_list_waypoints">Alla</string>
|
||||
<string name="shared_string_all">Alla</string>
|
||||
<string name="record_plugin_description">"Denna modul aktiveras funktionen att antingen spela in och spara dina spår genom att du trycker på widgeten GPX-inspelning på kartskärmen eller alla dina rutter sparas automatiskt i en GPX-fil.
|
||||
\n\nInspelade spår kan delas ut till vänner eller användas som bidrag till OSM. Idrottsmän kan använda inspelade spår för att följa sin träning. Viss grundläggande spåranalys kan göras direkt i OsmAnd, såsom varvtider, genomsnittshastighet etc och spår kan givetvis också analyseras i efterhand i speciella analysverktyg från tredje part. "</string>
|
||||
<string name="record_plugin_name">Inspelning av resor</string>
|
||||
|
|
|
@ -1906,7 +1906,7 @@ OsmAnd має відкриті сирці і активно розвиваєть
|
|||
<string name="duration">Тривалісьть</string>
|
||||
<string name="distance">Віддаль</string>
|
||||
<string name="index_tours">Подорожі</string>
|
||||
<string name="flat_list_waypoints">Усі</string>
|
||||
<string name="shared_string_all">Усі</string>
|
||||
<string name="waypoints">Путьові точки</string>
|
||||
<string name="targets">Цілі</string>
|
||||
<string name="way_alarms">Перешкоди</string>
|
||||
|
|
|
@ -1711,7 +1711,7 @@
|
|||
<string name="way_alarms">交通狀況提醒</string>
|
||||
<string name="speak_favorites">通報附近我的最愛</string>
|
||||
<string name="speak_poi">通報附近 POI</string>
|
||||
<string name="flat_list_waypoints">全部</string>
|
||||
<string name="shared_string_all">全部</string>
|
||||
<string name="index_tours">旅遊</string>
|
||||
<string name="record_plugin_description">"這個外掛元件在地圖螢幕上,以手動點觸 GPX 記錄小工具以啟動去記錄和儲存您軌跡的功能,或是自動記錄您所有的導航路線到 GPX 檔案。\n\n記錄的軌跡可以與您的朋友共享或用作為 OSM 的貢獻。運動選手可以使用記錄的軌跡,監看他們的訓練。一些基本的軌跡分析,可以直接在 OsmAnd 進行,如一圈的時間、平均速度等,而軌跡當然也可於事後在專門的第三方分析工具解析。 "</string>
|
||||
<string name="record_plugin_name">正在記錄行程</string>
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
-->
|
||||
<string name="rendering_attr_OSMMapperAssistant_name">OSM mapper assistant</string>
|
||||
<string name="agps_info">A-GPS info</string>
|
||||
<string name="shared_string_manage">Manage</string>
|
||||
<string name="shared_string_edit">Edit</string>
|
||||
<string name="shared_string_places">Places</string>
|
||||
<string name="shared_string_search">Search</string>
|
||||
<string name="shared_string_show_description">Show description</string>
|
||||
|
@ -205,7 +207,6 @@
|
|||
<string name="proxy_pref_descr">Setup a proxy internet communication</string>
|
||||
<string name="settings_privacy">Privacy</string>
|
||||
<string name="points">Points</string>
|
||||
<string name="osm_editing_manage">Manage</string>
|
||||
<string name="navigation_over_track">Start navigation along track?</string>
|
||||
<string name="avoid_roads_msg">You can trigger an alternative route by selecting roads to avoid</string>
|
||||
<string name="speak_pedestrian">Announce pedestrian crosswalks</string>
|
||||
|
@ -359,7 +360,7 @@
|
|||
<string name="duration">Duration</string>
|
||||
<string name="distance">Distance</string>
|
||||
<string name="index_tours">Tours</string>
|
||||
<string name="flat_list_waypoints">All</string>
|
||||
<string name="shared_string_all">All</string>
|
||||
<string name="waypoints">Waypoints</string>
|
||||
<string name="targets">Destinations</string>
|
||||
<string name="announce_gpx_waypoints">Announce GPX waypoints</string>
|
||||
|
|
|
@ -194,11 +194,6 @@ public class AppInitializer implements IProgress {
|
|||
|
||||
}
|
||||
|
||||
public void startMapActivity(final Activity ctx) {
|
||||
final Intent mapIndent = new Intent(ctx, ((OsmandApplication)ctx.getApplication()).getAppCustomization().getMapActivity());
|
||||
ctx.startActivityForResult(mapIndent, 0);
|
||||
}
|
||||
|
||||
// TODO
|
||||
private void applicationInstalledFirstTime(final Activity ctx) {
|
||||
final OsmandApplication app = (OsmandApplication)ctx.getApplication();
|
||||
|
|
|
@ -52,6 +52,7 @@ public class EditPOIFilterActivity extends OsmandListActivity {
|
|||
public static final String SEARCH_LAT = SearchActivity.SEARCH_LAT; //$NON-NLS-1$
|
||||
public static final String SEARCH_LON = SearchActivity.SEARCH_LON; //$NON-NLS-1$
|
||||
private static final int FILTER = 2;
|
||||
public static final int EDIT_ACTIVITY_RESULT_OK = 20;
|
||||
|
||||
|
||||
@Override
|
||||
|
@ -79,7 +80,9 @@ public class EditPOIFilterActivity extends OsmandListActivity {
|
|||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == FILTER) {
|
||||
filterPOI();
|
||||
// filterPOI();
|
||||
setResult(EDIT_ACTIVITY_RESULT_OK);
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
|
@ -112,21 +115,10 @@ public class EditPOIFilterActivity extends OsmandListActivity {
|
|||
}
|
||||
final double lat = latitude;
|
||||
final double lon = longitude;
|
||||
newIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||
newIntent.putExtra(SearchPOIActivity.AMENITY_FILTER, filter.getFilterId());
|
||||
if (searchNearBy) {
|
||||
AlertDialog.Builder b = new AlertDialog.Builder(EditPOIFilterActivity.this);
|
||||
b.setItems(new String[] { getString(R.string.search_nearby), getString(R.string.search_near_map) },
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
if (which == 1) {
|
||||
newIntent.putExtra(SearchPOIActivity.SEARCH_LAT, lat);
|
||||
newIntent.putExtra(SearchPOIActivity.SEARCH_LON, lon);
|
||||
}
|
||||
startActivity(newIntent);
|
||||
}
|
||||
});
|
||||
b.show();
|
||||
startActivity(newIntent);
|
||||
} else {
|
||||
newIntent.putExtra(SearchPOIActivity.SEARCH_LAT, lat);
|
||||
newIntent.putExtra(SearchPOIActivity.SEARCH_LON, lon);
|
||||
|
@ -261,7 +253,16 @@ public class EditPOIFilterActivity extends OsmandListActivity {
|
|||
check.setChecked(filter.isTypeAccepted(model));
|
||||
|
||||
TextView text = (TextView) row.findViewById(R.id.filter_poi_label);
|
||||
text.setText(model.getTranslation());
|
||||
String textString = model.getTranslation();
|
||||
Set<String> subtypes = filter.getAcceptedSubtypes(model);
|
||||
if(filter.isTypeAccepted(model)) {
|
||||
if(subtypes == null) {
|
||||
textString += " (" + getString(R.string.shared_string_all) +")";
|
||||
} else {
|
||||
textString += " (" + subtypes.size() +")";
|
||||
}
|
||||
}
|
||||
text.setText(textString);
|
||||
addRowListener(model, text, check);
|
||||
return (row);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import net.osmand.plus.OsmandSettings;
|
|||
import net.osmand.plus.OsmandSettings.CommonPreference;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.SQLiteTileSource;
|
||||
import net.osmand.plus.activities.search.SearchActivity;
|
||||
import net.osmand.plus.helpers.GpxUiHelper;
|
||||
import net.osmand.plus.poi.PoiFiltersHelper;
|
||||
import net.osmand.plus.poi.PoiLegacyFilter;
|
||||
|
@ -262,7 +263,9 @@ public class MapActivityLayers {
|
|||
for (PoiLegacyFilter f : poiFilters.getTopDefinedPoiFilters()) {
|
||||
addFilterToList(adapter, list, f);
|
||||
}
|
||||
addFilterToList(adapter, list, poiFilters.getCustomPOIFilter());
|
||||
list.add(poiFilters.getCustomPOIFilter());
|
||||
adapter.item(R.string.shared_string_search).iconColor(R.drawable.ic_action_search_dark).reg();
|
||||
|
||||
Builder builder = new AlertDialog.Builder(activity);
|
||||
ListAdapter listAdapter = adapter.createListAdapter(activity, app.getSettings().isLightContent());
|
||||
builder.setAdapter(listAdapter, new DialogInterface.OnClickListener(){
|
||||
|
@ -272,12 +275,10 @@ public class MapActivityLayers {
|
|||
PoiLegacyFilter pf = list.get(which);
|
||||
String filterId = pf.getFilterId();
|
||||
if(filterId.equals(PoiLegacyFilter.CUSTOM_FILTER_ID)){
|
||||
getApplication().getSettings().setPoiFilterForMap(filterId);
|
||||
Intent newIntent = new Intent(activity, EditPOIFilterActivity.class);
|
||||
newIntent.putExtra(EditPOIFilterActivity.AMENITY_FILTER, filterId);
|
||||
newIntent.putExtra(EditPOIFilterActivity.SEARCH_LAT, mapView.getLatitude());
|
||||
newIntent.putExtra(EditPOIFilterActivity.SEARCH_LON, mapView.getLongitude());
|
||||
activity.startActivity(newIntent);
|
||||
Intent search = new Intent(activity, SearchActivity.class);
|
||||
search.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||
activity.getMyApplication().getSettings().SEARCH_TAB.set(SearchActivity.POI_TAB_INDEX);
|
||||
activity.startActivity(search);
|
||||
} else {
|
||||
getApplication().getSettings().setPoiFilterForMap(filterId);
|
||||
pf = poiFilters.getFilterById(filterId);
|
||||
|
|
|
@ -20,6 +20,7 @@ import net.osmand.data.Amenity;
|
|||
import net.osmand.data.LatLon;
|
||||
import net.osmand.data.PointDescription;
|
||||
import net.osmand.osm.PoiType;
|
||||
import net.osmand.plus.IconsCache;
|
||||
import net.osmand.plus.OsmAndFormatter;
|
||||
import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener;
|
||||
import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener;
|
||||
|
@ -27,6 +28,7 @@ import net.osmand.plus.OsmandApplication;
|
|||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.R.color;
|
||||
import net.osmand.plus.activities.EditPOIFilterActivity;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.activities.OsmandListActivity;
|
||||
import net.osmand.plus.dashboard.DashLocationFragment;
|
||||
|
@ -43,6 +45,7 @@ import android.app.AlertDialog;
|
|||
import android.app.AlertDialog.Builder;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.AsyncTask.Status;
|
||||
|
@ -106,6 +109,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
private MenuItem showFilterItem;
|
||||
private MenuItem showOnMapItem;
|
||||
private MenuItem searchPOILevel;
|
||||
private static int RESULT_REQUEST_CODE = 54;
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu omenu) {
|
||||
|
@ -234,15 +238,17 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
findViewById(R.id.options).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
showOptionsMenu(v);
|
||||
}
|
||||
});
|
||||
updateIntent(getIntent());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
Bundle bundle = this.getIntent().getExtras();
|
||||
public void updateIntent(Intent intent) {
|
||||
Bundle bundle = intent.getExtras();
|
||||
if (bundle.containsKey(SEARCH_LAT) && bundle.containsKey(SEARCH_LON)) {
|
||||
location = new net.osmand.Location("internal"); //$NON-NLS-1$
|
||||
location.setLatitude(bundle.getDouble(SEARCH_LAT));
|
||||
|
@ -254,31 +260,45 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
}
|
||||
|
||||
String filterId = bundle.getString(AMENITY_FILTER);
|
||||
PoiLegacyFilter filter = app.getPoiFilters().getFilterById(filterId);
|
||||
if (filter != this.filter) {
|
||||
this.filter = filter;
|
||||
if (filter != null) {
|
||||
filter.clearPreviousZoom();
|
||||
this.filter = app.getPoiFilters().getFilterById(filterId);
|
||||
if (filter != null) {
|
||||
if(filter.isEmpty() && !isNameSearch()) {
|
||||
showEditActivity(filter);
|
||||
} else {
|
||||
amenityAdapter.setNewModel(Collections.<Amenity> emptyList());
|
||||
filter.clearPreviousZoom();
|
||||
// run query again
|
||||
runNewSearchQuery(location, NEW_SEARCH_INIT);
|
||||
}
|
||||
// run query again
|
||||
runNewSearchQuery(location, NEW_SEARCH_INIT);
|
||||
} else {
|
||||
amenityAdapter.setNewModel(Collections.<Amenity> emptyList());
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
updateIntent(intent);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
updateButtonState();
|
||||
if (filter != null) {
|
||||
String text = filter.getFilterByName() != null ? filter.getFilterByName() : "";
|
||||
searchFilter.setText(text);
|
||||
searchFilterLayout.setVisibility(text.length() > 0 || isNameSearch() ? View.VISIBLE : View.GONE);
|
||||
|
||||
}
|
||||
if (filter != null) {
|
||||
if (searchNearBy) {
|
||||
app.getLocationProvider().addLocationListener(this);
|
||||
location = app.getLocationProvider().getLastKnownLocation();
|
||||
app.getLocationProvider().resumeAllUpdates();
|
||||
}
|
||||
updateLocation(location);
|
||||
|
||||
if (searchNearBy) {
|
||||
app.getLocationProvider().addLocationListener(this);
|
||||
location = app.getLocationProvider().getLastKnownLocation();
|
||||
app.getLocationProvider().resumeAllUpdates();
|
||||
}
|
||||
updateLocation(location);
|
||||
|
||||
// Freeze the direction arrows (reference is constant north) when Accessibility mode = ON, so screen can be read
|
||||
// aloud without continuous updates
|
||||
|
@ -300,6 +320,55 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
}
|
||||
updateButtonState();
|
||||
}
|
||||
|
||||
|
||||
private void showOptionsMenu(View v) {
|
||||
// Show menu with search all, name finder, name finder poi
|
||||
IconsCache iconsCache = getMyApplication().getIconsCache();
|
||||
final PopupMenu optionsMenu = new PopupMenu(this, v);
|
||||
|
||||
final PoiLegacyFilter f = this.filter;
|
||||
MenuItem item = optionsMenu.getMenu().add(R.string.shared_string_edit)
|
||||
.setIcon(iconsCache.getContentIcon(R.drawable.ic_action_edit_dark));
|
||||
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
PoiLegacyFilter custom = getMyApplication().getPoiFilters().getCustomPOIFilter();
|
||||
custom.updateTypesToAccept(f);
|
||||
showEditActivity(custom);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
optionsMenu.show();
|
||||
}
|
||||
|
||||
private void showEditActivity(PoiLegacyFilter poi) {
|
||||
Intent newIntent = new Intent(this, EditPOIFilterActivity.class);
|
||||
// folder selected
|
||||
newIntent.putExtra(EditPOIFilterActivity.AMENITY_FILTER, poi.getFilterId());
|
||||
if(location != null && !searchNearBy) {
|
||||
newIntent.putExtra(SearchActivity.SEARCH_LAT, location.getLatitude());
|
||||
newIntent.putExtra(SearchActivity.SEARCH_LON, location.getLongitude());
|
||||
}
|
||||
startActivityForResult(newIntent, RESULT_REQUEST_CODE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (requestCode == RESULT_REQUEST_CODE && resultCode == EditPOIFilterActivity.EDIT_ACTIVITY_RESULT_OK) {
|
||||
PoiLegacyFilter custom = app.getPoiFilters().getCustomPOIFilter();
|
||||
if(this.filter.isStandardFilter()) {
|
||||
PoiLegacyFilter old = this.filter;
|
||||
this.filter = custom;
|
||||
this.filter.setFilterByName(old.getFilterByName());
|
||||
} else {
|
||||
this.filter.updateTypesToAccept(custom);
|
||||
}
|
||||
}
|
||||
if (filter == null || filter.isEmpty()) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
private void updateButtonState() {
|
||||
if (showFilterItem != null) {
|
||||
|
@ -795,6 +864,11 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.edit_filter_save_as_menu_item);
|
||||
final EditText editText = new EditText(this);
|
||||
if(filter.isStandardFilter()) {
|
||||
editText.setText((filter.getName() + " " + searchFilter.getText()).trim());
|
||||
} else {
|
||||
editText.setText(filter.getName());
|
||||
}
|
||||
LinearLayout ll = new LinearLayout(this);
|
||||
ll.setPadding(5, 3, 5, 0);
|
||||
ll.addView(editText, new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
|
||||
|
@ -821,4 +895,5 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
builder.create().show();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -163,14 +163,6 @@ public class SearchPoiFilterFragment extends ListFragment implements SearchActiv
|
|||
}
|
||||
}
|
||||
|
||||
private void showEditActivity(PoiLegacyFilter poi) {
|
||||
Intent newIntent = new Intent(getActivity(), EditPOIFilterActivity.class);
|
||||
// folder selected
|
||||
newIntent.putExtra(EditPOIFilterActivity.AMENITY_FILTER, poi.getFilterId());
|
||||
updateIntentToLaunch(newIntent);
|
||||
startActivity(newIntent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onListItemClick(ListView listView, View v, int position, long id) {
|
||||
final Object item = ((PoiFiltersAdapter) getListAdapter()).getItem(position);
|
||||
|
@ -292,7 +284,7 @@ public class SearchPoiFilterFragment extends ListFragment implements SearchActiv
|
|||
public boolean onMenuItemClick(MenuItem item) {
|
||||
PoiLegacyFilter filter = getApp().getPoiFilters().getCustomPOIFilter();
|
||||
filter.clearFilter();
|
||||
showEditActivity(filter);
|
||||
showFilterActivity(filter.getFilterId());
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -42,7 +42,7 @@ public class DashOsmEditsFragment extends DashBaseFragment implements OsmEditsUp
|
|||
TextView header = ((TextView) view.findViewById(R.id.fav_text));
|
||||
header.setText(R.string.osm_settings);
|
||||
Button manage = ((Button) view.findViewById(R.id.show_all));
|
||||
manage.setText(R.string.osm_editing_manage);
|
||||
manage.setText(R.string.shared_string_manage);
|
||||
(view.findViewById(R.id.show_all)).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
|
|
@ -61,7 +61,9 @@ public class OpenstreetmapLocalUtil implements OpenstreetmapUtil {
|
|||
n.getLocation().getLongitude(),
|
||||
nodeId);
|
||||
entity.putTag(st.getOsmTag(), st.getOsmValue());
|
||||
entity.putTag(st.getOsmTag2(), st.getOsmValue2());
|
||||
if(st.getOsmTag2() != null) {
|
||||
entity.putTag(st.getOsmTag2(), st.getOsmValue2());
|
||||
}
|
||||
entity.putTag(OSMTagKey.NAME.getValue(), n.getName());
|
||||
entity.putTag(OSMTagKey.OPENING_HOURS.getValue(), n.getOpeningHours());
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.text.Collator;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
|
@ -122,7 +123,7 @@ public class PoiFiltersHelper {
|
|||
}
|
||||
if(filterId.startsWith(PoiLegacyFilter.STD_PREFIX)) {
|
||||
String typeId = filterId.substring(PoiLegacyFilter.STD_PREFIX.length());
|
||||
PoiType tp = application.getPoiTypes().getPoiTypeByKey(typeId);
|
||||
AbstractPoiType tp = application.getPoiTypes().getAnyPoiTypeByKey(typeId);
|
||||
if(tp != null) {
|
||||
PoiLegacyFilter lf = new PoiLegacyFilter(tp, application);
|
||||
cacheTopStandardFilters.add(lf);
|
||||
|
@ -215,7 +216,14 @@ public class PoiFiltersHelper {
|
|||
if(helper == null){
|
||||
return false;
|
||||
}
|
||||
boolean res = helper.addFilter(filter, helper.getWritableDatabase(), false);
|
||||
boolean res = helper.deleteFilter(helper.getWritableDatabase(), filter);
|
||||
Iterator<PoiLegacyFilter> it = cacheTopStandardFilters.iterator();
|
||||
while(it.hasNext()) {
|
||||
if(it.next().getFilterId().equals(filter.getFilterId())) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
res = helper.addFilter(filter, helper.getWritableDatabase(), false);
|
||||
if(res){
|
||||
cacheTopStandardFilters.add(filter);
|
||||
sortListOfFilters(cacheTopStandardFilters);
|
||||
|
|
|
@ -20,6 +20,7 @@ import net.osmand.data.LatLon;
|
|||
import net.osmand.osm.AbstractPoiType;
|
||||
import net.osmand.osm.MapPoiTypes;
|
||||
import net.osmand.osm.PoiCategory;
|
||||
import net.osmand.osm.PoiFilter;
|
||||
import net.osmand.osm.PoiType;
|
||||
import net.osmand.plus.OsmAndFormatter;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
|
@ -356,6 +357,11 @@ public class PoiLegacyFilter implements SearchPoiTypeFilter {
|
|||
pt.putTypes(acceptedTypes);
|
||||
}
|
||||
|
||||
public void updateTypesToAccept(PoiLegacyFilter f) {
|
||||
acceptedTypes.clear();
|
||||
acceptedTypes.putAll(f.acceptedTypes);
|
||||
}
|
||||
|
||||
|
||||
public Map<PoiCategory, LinkedHashSet<String>> getAcceptedTypes(){
|
||||
return new LinkedHashMap<PoiCategory, LinkedHashSet<String>>(acceptedTypes);
|
||||
|
|
Loading…
Reference in a new issue