Merge branch 'master' of https://github.com/osmandapp/Osmand
This commit is contained in:
commit
2cd92f80ff
18 changed files with 435 additions and 218 deletions
|
@ -1,4 +1,14 @@
|
|||
package net.osmand.search;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import net.osmand.Collator;
|
||||
import net.osmand.OsmAndCollator;
|
||||
|
@ -25,23 +35,12 @@ import net.osmand.util.MapUtils;
|
|||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class SearchUICore {
|
||||
|
||||
private static final int TIMEOUT_BETWEEN_CHARS = 200;
|
||||
private static final Log LOG = PlatformUtil.getLog(SearchUICore.class);
|
||||
private SearchPhrase phrase;
|
||||
private SearchResultCollection currentSearchResult = new SearchResultCollection();
|
||||
private SearchResultCollection currentSearchResult;
|
||||
|
||||
private ThreadPoolExecutor singleThreadedExecutor;
|
||||
private LinkedBlockingQueue<Runnable> taskQueue;
|
||||
|
@ -52,7 +51,6 @@ public class SearchUICore {
|
|||
List<SearchCoreAPI> apis = new ArrayList<>();
|
||||
private SearchSettings searchSettings;
|
||||
private MapPoiTypes poiTypes;
|
||||
private Collator collator;
|
||||
|
||||
|
||||
public SearchUICore(MapPoiTypes poiTypes, String locale) {
|
||||
|
@ -60,31 +58,146 @@ public class SearchUICore {
|
|||
taskQueue = new LinkedBlockingQueue<Runnable>();
|
||||
searchSettings = new SearchSettings(new ArrayList<BinaryMapIndexReader>());
|
||||
searchSettings = searchSettings.setLang(locale);
|
||||
phrase = new SearchPhrase(searchSettings);
|
||||
phrase = new SearchPhrase(searchSettings, OsmAndCollator.primaryCollator());
|
||||
currentSearchResult = new SearchResultCollection(phrase);
|
||||
singleThreadedExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, taskQueue);
|
||||
collator = OsmAndCollator.primaryCollator();
|
||||
}
|
||||
|
||||
public static class SearchResultCollection {
|
||||
private List<SearchResult> searchResults;
|
||||
private SearchPhrase phrase;
|
||||
|
||||
public SearchResultCollection(List<SearchResult> requestResults, SearchPhrase phrase) {
|
||||
searchResults = requestResults;
|
||||
public SearchResultCollection(SearchPhrase phrase) {
|
||||
searchResults = new ArrayList<>();
|
||||
this.phrase = phrase;
|
||||
}
|
||||
|
||||
public SearchResultCollection() {
|
||||
searchResults = new ArrayList<>();
|
||||
public SearchResultCollection combineWithCollection(SearchResultCollection collection, boolean resort, boolean removeDuplicates) {
|
||||
SearchResultCollection src = new SearchResultCollection(phrase);
|
||||
src.addSearchResults(searchResults, false, false);
|
||||
src.addSearchResults(collection.searchResults, resort, removeDuplicates);
|
||||
return src;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void addSearchResults(List<SearchResult> sr, boolean resortAll, boolean removeDuplicates) {
|
||||
if(resortAll) {
|
||||
this.searchResults.addAll(sr);
|
||||
sortSearchResults();
|
||||
if(removeDuplicates) {
|
||||
filterSearchDuplicateResults();
|
||||
}
|
||||
} else {
|
||||
if(removeDuplicates) {
|
||||
ArrayList<SearchResult> addedResults = new ArrayList<>(sr);
|
||||
SearchResultComparator cmp = new SearchResultComparator(phrase);
|
||||
Collections.sort(addedResults, cmp);
|
||||
filterSearchDuplicateResults(addedResults);
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
while(j < addedResults.size()) {
|
||||
SearchResult addedResult = addedResults.get(j);
|
||||
if(i >= searchResults.size()) {
|
||||
if(searchResults.size() == 0 ||
|
||||
!sameSearchResult(addedResult, searchResults.get(searchResults.size() - 1))) {
|
||||
searchResults.add(addedResult);
|
||||
}
|
||||
j++;
|
||||
continue;
|
||||
}
|
||||
SearchResult existingResult = searchResults.get(i);
|
||||
if(sameSearchResult(addedResult, existingResult)) {
|
||||
j++;
|
||||
continue;
|
||||
}
|
||||
int compare = cmp.compare(existingResult, addedResult);
|
||||
if(compare == 0) {
|
||||
// existingResult == addedResult
|
||||
j++;
|
||||
} else if(compare > 0) {
|
||||
// existingResult > addedResult
|
||||
this.searchResults.add(addedResults.get(j));
|
||||
j++;
|
||||
} else {
|
||||
// existingResult < addedResult
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public List<SearchResult> getCurrentSearchResults() {
|
||||
return searchResults;
|
||||
return Collections.unmodifiableList(searchResults);
|
||||
}
|
||||
|
||||
public SearchPhrase getPhrase() {
|
||||
return phrase;
|
||||
}
|
||||
|
||||
public void sortSearchResults() {
|
||||
Collections.sort(searchResults, new SearchResultComparator(phrase));
|
||||
}
|
||||
|
||||
public void filterSearchDuplicateResults() {
|
||||
filterSearchDuplicateResults(searchResults);
|
||||
}
|
||||
|
||||
private void filterSearchDuplicateResults(List<SearchResult> lst) {
|
||||
Iterator<SearchResult> it = lst.iterator();
|
||||
SearchResult found = null;
|
||||
while(it.hasNext()) {
|
||||
SearchResult r = it.next();
|
||||
if(found != null && sameSearchResult(found, r)) {
|
||||
it.remove();
|
||||
} else {
|
||||
found = r;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public boolean sameSearchResult(SearchResult r1, SearchResult r2) {
|
||||
if(r1.location != null && r2.location != null) {
|
||||
Amenity a1 = null;
|
||||
if(r1.object instanceof Amenity) {
|
||||
a1 = (Amenity) r1.object;
|
||||
}
|
||||
Amenity a2 = null;
|
||||
if(r2.object instanceof Amenity) {
|
||||
a2 = (Amenity) r2.object;
|
||||
}
|
||||
if (r1.localeName.equals(r2.localeName)) {
|
||||
double similarityRadius = 30;
|
||||
if (a1 != null && a2 != null) {
|
||||
// here 2 points are amenity
|
||||
String type1 = a1.getType().getKeyName();
|
||||
String type2 = a2.getType().getKeyName();
|
||||
String subType1 = a1.getSubType();
|
||||
String subType2 = a2.getSubType();
|
||||
if (!type1.equals(type2)) {
|
||||
return false;
|
||||
}
|
||||
if (type1.equals("natural")) {
|
||||
similarityRadius = 10000;
|
||||
} else if (subType1.equals(subType2)) {
|
||||
if (subType1.contains("cn_ref") || subType1.contains("wn_ref")
|
||||
|| (subType1.startsWith("route_hiking_") && subType1.endsWith("n_poi"))) {
|
||||
similarityRadius = 10000;
|
||||
}
|
||||
}
|
||||
} else if(ObjectType.isAddress(r1.objectType) && ObjectType.isAddress(r2.objectType)) {
|
||||
similarityRadius = 100;
|
||||
}
|
||||
return MapUtils.getDistance(r1.location, r2.location) < similarityRadius;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void setPoiTypes(MapPoiTypes poiTypes) {
|
||||
|
@ -111,7 +224,6 @@ public class SearchUICore {
|
|||
|
||||
public <T extends SearchCoreAPI> SearchResultCollection shallowSearch(Class<T> cl,
|
||||
String text, final ResultMatcher<SearchResult> matcher) throws IOException {
|
||||
SearchResultCollection quickRes = new SearchResultCollection();
|
||||
T api = getApiByClass(cl);
|
||||
if(api != null) {
|
||||
SearchPhrase sphrase = this.phrase.generateNewPhrase(text, searchSettings);
|
||||
|
@ -120,14 +232,13 @@ public class SearchUICore {
|
|||
SearchResultMatcher rm = new SearchResultMatcher(matcher, ai.get(), ai, totalLimit);
|
||||
api.search(sphrase, rm);
|
||||
|
||||
sortSearchResults(sphrase, rm.getRequestResults());
|
||||
filterSearchDuplicateResults(sphrase, rm.getRequestResults());
|
||||
|
||||
LOG.info(">> Shallow Search phrase " + phrase + " " + rm.getRequestResults().size());
|
||||
return new SearchResultCollection(rm.getRequestResults(),
|
||||
SearchResultCollection collection = new SearchResultCollection(
|
||||
sphrase);
|
||||
collection.addSearchResults(rm.getRequestResults(), true, true);
|
||||
LOG.info(">> Shallow Search phrase " + phrase + " " + rm.getRequestResults().size());
|
||||
return collection;
|
||||
}
|
||||
return quickRes;
|
||||
return null;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
|
@ -201,11 +312,10 @@ public class SearchUICore {
|
|||
}
|
||||
|
||||
public SearchResultCollection search(final String text, final ResultMatcher<SearchResult> matcher) {
|
||||
SearchResultCollection quickRes = new SearchResultCollection();
|
||||
final int request = requestNumber.incrementAndGet();
|
||||
final SearchPhrase phrase = this.phrase.generateNewPhrase(text, searchSettings);
|
||||
this.phrase = phrase;
|
||||
quickRes.phrase = phrase;
|
||||
SearchResultCollection quickRes = new SearchResultCollection(phrase);
|
||||
filterCurrentResults(quickRes.searchResults, phrase);
|
||||
LOG.info("> Search phrase " + phrase + " " + quickRes.searchResults.size());
|
||||
singleThreadedExecutor.submit(new Runnable() {
|
||||
|
@ -222,12 +332,11 @@ public class SearchUICore {
|
|||
}
|
||||
searchInBackground(phrase, rm);
|
||||
if (!rm.isCancelled()) {
|
||||
sortSearchResults(phrase, rm.getRequestResults());
|
||||
filterSearchDuplicateResults(phrase, rm.getRequestResults());
|
||||
|
||||
LOG.info(">> Search phrase " + phrase + " " + rm.getRequestResults().size());
|
||||
SearchResultCollection collection = new SearchResultCollection(rm.getRequestResults(),
|
||||
SearchResultCollection collection = new SearchResultCollection(
|
||||
phrase);
|
||||
collection.addSearchResults(rm.getRequestResults(), true, true);
|
||||
LOG.info(">> Search phrase " + phrase + " " + rm.getRequestResults().size());
|
||||
currentSearchResult = collection;
|
||||
if (onResultsComplete != null) {
|
||||
onResultsComplete.run();
|
||||
|
@ -267,6 +376,7 @@ public class SearchUICore {
|
|||
}
|
||||
try {
|
||||
api.search(phrase, matcher);
|
||||
|
||||
matcher.apiSearchFinished(api, phrase);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
|
@ -284,92 +394,10 @@ public class SearchUICore {
|
|||
phrase.sortFiles();
|
||||
}
|
||||
|
||||
public boolean sameSearchResult(SearchResult r1, SearchResult r2) {
|
||||
if(r1.location != null && r2.location != null) {
|
||||
Amenity a1 = null;
|
||||
if(r1.object instanceof Amenity) {
|
||||
a1 = (Amenity) r1.object;
|
||||
}
|
||||
Amenity a2 = null;
|
||||
if(r2.object instanceof Amenity) {
|
||||
a2 = (Amenity) r2.object;
|
||||
}
|
||||
if (r1.localeName.equals(r2.localeName)) {
|
||||
double similarityRadius = 30;
|
||||
if (a1 != null && a2 != null) {
|
||||
// here 2 points are amenity
|
||||
String type1 = a1.getType().getKeyName();
|
||||
String type2 = a2.getType().getKeyName();
|
||||
String subType1 = a1.getSubType();
|
||||
String subType2 = a2.getSubType();
|
||||
if (!type1.equals(type2)) {
|
||||
return false;
|
||||
}
|
||||
if (type1.equals("natural")) {
|
||||
similarityRadius = 10000;
|
||||
} else if (subType1.equals(subType2)) {
|
||||
if (subType1.contains("cn_ref") || subType1.contains("wn_ref")
|
||||
|| (subType1.startsWith("route_hiking_") && subType1.endsWith("n_poi"))) {
|
||||
similarityRadius = 10000;
|
||||
}
|
||||
}
|
||||
} else if(ObjectType.isAddress(r1.objectType) && ObjectType.isAddress(r2.objectType)) {
|
||||
similarityRadius = 100;
|
||||
}
|
||||
return MapUtils.getDistance(r1.location, r2.location) < similarityRadius;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void filterSearchDuplicateResults(SearchPhrase sp, List<SearchResult> searchResults) {
|
||||
Iterator<SearchResult> it = searchResults.iterator();
|
||||
SearchResult found = null;
|
||||
while(it.hasNext()) {
|
||||
SearchResult r = it.next();
|
||||
if(found != null && sameSearchResult(found, r)) {
|
||||
it.remove();
|
||||
} else {
|
||||
found = r;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void sortSearchResults(SearchPhrase sp, List<SearchResult> searchResults) {
|
||||
// sort SearchResult by 1. searchDistance 2. Name
|
||||
final LatLon loc = sp.getLastTokenLocation();
|
||||
Collections.sort(searchResults, new Comparator<SearchResult>() {
|
||||
|
||||
@Override
|
||||
public int compare(SearchResult o1, SearchResult o2) {
|
||||
if(o1.getFoundWordCount() != o2.getFoundWordCount()) {
|
||||
return -Algorithms.compare(o1.getFoundWordCount(), o2.getFoundWordCount());
|
||||
}
|
||||
double s1 = o1.getSearchDistance(loc);
|
||||
double s2 = o2.getSearchDistance(loc);
|
||||
int cmp = Double.compare(s1, s2);
|
||||
if(cmp != 0) {
|
||||
return cmp;
|
||||
}
|
||||
int st1 = Algorithms.extractFirstIntegerNumber(o1.localeName);
|
||||
int st2 = Algorithms.extractFirstIntegerNumber(o2.localeName);
|
||||
if(st1 != st2) {
|
||||
return Algorithms.compare(st1, st2);
|
||||
}
|
||||
cmp = collator.compare(o1.localeName, o2.localeName);
|
||||
if(cmp != 0) {
|
||||
return cmp;
|
||||
}
|
||||
s1 = o1.getSearchDistance(loc, 1);
|
||||
s2 = o2.getSearchDistance(loc, 1);
|
||||
return Double.compare(s1, s2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static class SearchResultMatcher
|
||||
implements ResultMatcher<SearchResult>{
|
||||
public static class SearchResultMatcher implements ResultMatcher<SearchResult>{
|
||||
private final List<SearchResult> requestResults = new ArrayList<>();
|
||||
private final ResultMatcher<SearchResult> matcher;
|
||||
private final int request;
|
||||
|
@ -439,5 +467,43 @@ public class SearchUICore {
|
|||
boolean cancelled = request != requestNumber.get();
|
||||
return cancelled || (matcher != null && matcher.isCancelled());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class SearchResultComparator implements Comparator<SearchResult> {
|
||||
private SearchPhrase sp;
|
||||
private Collator collator;
|
||||
private LatLon loc;
|
||||
|
||||
public SearchResultComparator(SearchPhrase sp) {
|
||||
this.sp = sp;
|
||||
this.collator = sp.getCollator();
|
||||
loc = sp.getLastTokenLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compare(SearchResult o1, SearchResult o2) {
|
||||
if(o1.getFoundWordCount() != o2.getFoundWordCount()) {
|
||||
return -Algorithms.compare(o1.getFoundWordCount(), o2.getFoundWordCount());
|
||||
}
|
||||
double s1 = o1.getSearchDistance(loc);
|
||||
double s2 = o2.getSearchDistance(loc);
|
||||
int cmp = Double.compare(s1, s2);
|
||||
if(cmp != 0) {
|
||||
return cmp;
|
||||
}
|
||||
int st1 = Algorithms.extractFirstIntegerNumber(o1.localeName);
|
||||
int st2 = Algorithms.extractFirstIntegerNumber(o2.localeName);
|
||||
if(st1 != st2) {
|
||||
return Algorithms.compare(st1, st2);
|
||||
}
|
||||
cmp = collator.compare(o1.localeName, o2.localeName);
|
||||
if(cmp != 0) {
|
||||
return cmp;
|
||||
}
|
||||
s1 = o1.getSearchDistance(loc, 1);
|
||||
s2 = o2.getSearchDistance(loc, 1);
|
||||
return Double.compare(s1, s2);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,10 @@ import java.util.List;
|
|||
import java.util.TreeSet;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import net.osmand.Collator;
|
||||
import net.osmand.CollatorStringMatcher;
|
||||
import net.osmand.CollatorStringMatcher.StringMatcherMode;
|
||||
import net.osmand.OsmAndCollator;
|
||||
import net.osmand.StringMatcher;
|
||||
import net.osmand.binary.BinaryMapIndexReader;
|
||||
import net.osmand.binary.BinaryMapIndexReader.SearchRequest;
|
||||
|
@ -37,6 +39,7 @@ public class SearchPhrase {
|
|||
private static final String DELIMITER = " ";
|
||||
private static final String ALLDELIMITERS = "\\s|,";
|
||||
private static final Pattern reg = Pattern.compile(ALLDELIMITERS);
|
||||
private Collator clt;
|
||||
|
||||
|
||||
public enum SearchPhraseDataType {
|
||||
|
@ -44,12 +47,17 @@ public class SearchPhrase {
|
|||
}
|
||||
|
||||
|
||||
public SearchPhrase(SearchSettings settings) {
|
||||
public SearchPhrase(SearchSettings settings, Collator clt) {
|
||||
this.settings = settings;
|
||||
this.clt = clt;
|
||||
}
|
||||
|
||||
public Collator getCollator() {
|
||||
return clt;
|
||||
}
|
||||
|
||||
public SearchPhrase generateNewPhrase(String text, SearchSettings settings) {
|
||||
SearchPhrase sp = new SearchPhrase(settings);
|
||||
SearchPhrase sp = new SearchPhrase(settings, this.clt);
|
||||
String restText = text;
|
||||
List<SearchWord> leftWords = this.words;
|
||||
String thisTxt = getText(true);
|
||||
|
@ -259,7 +267,7 @@ public class SearchPhrase {
|
|||
}
|
||||
|
||||
public SearchPhrase selectWord(SearchResult res, List<String> unknownWords, boolean lastComplete) {
|
||||
SearchPhrase sp = new SearchPhrase(this.settings);
|
||||
SearchPhrase sp = new SearchPhrase(this.settings, this.clt);
|
||||
addResult(res, sp);
|
||||
SearchResult prnt = res.parentSearchResult;
|
||||
while(prnt != null) {
|
||||
|
|
|
@ -2,6 +2,7 @@ package net.osmand.search;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.osmand.OsmAndCollator;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.search.SearchUICore.SearchResultMatcher;
|
||||
import net.osmand.search.core.SearchCoreFactory;
|
||||
|
@ -16,7 +17,7 @@ public class LocationSearchTest {
|
|||
private void search(String string, LatLon latLon) throws IOException {
|
||||
SearchResultMatcher srm = new SearchUICore.SearchResultMatcher(null, 0, null, 100);
|
||||
new SearchCoreFactory.SearchLocationAndUrlAPI().
|
||||
search(new SearchPhrase(null).generateNewPhrase(string, null), srm);
|
||||
search(new SearchPhrase(null, OsmAndCollator.primaryCollator()).generateNewPhrase(string, null), srm);
|
||||
Assert.assertEquals(1, srm.getRequestResults().size());
|
||||
Assert.assertEquals(latLon, srm.getRequestResults().get(0).location);
|
||||
}
|
||||
|
|
|
@ -2264,7 +2264,7 @@ OsmAnd هو المصدر المفتوح و التي يجري تطويرها بن
|
|||
• تحسينات في مرشد الطراقات، الإعلانات الصوتية والدوران
|
||||
|
||||
|
||||
• واجهة نقل محسنة
|
||||
• تحسين كل من واجهة النقل وتحديد طريق الوجهة
|
||||
|
||||
|
||||
• إضافة المزيد من اللغات المحلية والآن ندعم لغات إقليمية
|
||||
|
@ -2469,7 +2469,7 @@ OsmAnd هو المصدر المفتوح و التي يجري تطويرها بن
|
|||
|
||||
هاته الرؤية يمكن التراجع عنها إما عن طريق تعطيلها هنا، أو تغيير \'نمط الخريطة\' في \'ضبط الخريطة\' حسب الرغبة.
|
||||
"</string>
|
||||
<string name="create_poi_link_to_osm_doc">تصنيف خريطة <u> الموقع </u> مع الصور</string>
|
||||
<string name="create_poi_link_to_osm_doc">تصنيف الخريطة <u> على الإنترنت</u> مع الصور</string>
|
||||
<string name="background_service_wait_int_descr">تعيين الحد الأقصى لوقت الانتظار لكل إصلاح موقع في الخلفية</string>
|
||||
<string name="background_service_wait_int">الانتظار الأقصى للإصلاح</string>
|
||||
<string name="voice_data_not_supported">إصدار غير معتمد من البيانات الصوتية</string>
|
||||
|
@ -2496,5 +2496,22 @@ OsmAnd هو المصدر المفتوح و التي يجري تطويرها بن
|
|||
<string name="value_downloaded_of_max">%1$.1f من %2$.1f مب</string>
|
||||
<string name="file_size_in_mb">%.1f مب</string>
|
||||
<string name="plugin_ski_descr">"أداة التطبيق هاته تضع بين أصابعك تفاصيل منحدرات تزلج عالمية، مسارات تزلج عبر كامل البلاد، التلفريك ومصاعد التزلج. الطرقات والمعابر مبينة بألوان حسب الصعوبة، ومصورة بنمط خريطة مميز \'شتوي\' تمثل مناظر الطبيعة بلون مثلج شتوي
|
||||
"</string>
|
||||
<string name="osmand_plus_extended_description_4000_chars_v2">"
|
||||
العثور على خريطة مواقع أوسماند خرائط & التنقل-وحساب الطرق دون اتصال بإنترنت. تحميل خريطة للبلد قبل أن تذهب في رحلة للعثور على الأماكن والطرق في منطقة غير مألوفة.
|
||||
|
||||
خيارات أساسية: • خرائط مفصلة للبلدان 200 • الملاح دون اتصال مع صوت يطالب • عنوان البحث في وضع دون اتصال • معلومات حول مواقع على الخريطة: أماكن الفائدة، المقاهي، مواقف السيارات، ومحلات • إضافة المواقع إلى المفضلة • القيادة، ركوب الدراجات وملاحه المشاة خيارات إضافية: • القدرة على عرض وتسجيل GPX المسارات وصف ويكيبيديا • البوي • إضافة الصورة، الصوت، والفيديو تلاحظ أن • خريطة خريطة في أوضاع ليلا ونهارا ل • القيادة أكثر ملاءمة المعلومات حول طرق النقل العام وتوقف مسارات الدراجات • و • ممرات المشي مسارات للسياحة في جميع أنحاء العالم • خرائط على الإنترنت من • مصادر عديدة من المعلومات حول جودة رصف الطرق وإنارة الشوارع • إضافة، تحرير، وحذف البوي (بالنسبة للمستخدمين OpenStreetMap.org) • أوسمو-رصد لايف لأجهزة أخرى الحصول على الملاح موثوق بها في بلدكم--سواء كان ذلك في فرنسا، وألمانيا، والمكسيك، والمملكة المتحدة، إسبانيا، هولندا، الولايات المتحدة الأمريكية، روسيا، البرازيل أو أي دولة أخرى.
|
||||
|
||||
الإضافات: • كفاف الخرائط والتضاريس التظليل https://goo.gl/7mojP8 الخطوط الكنتورية البيانات والتصور التضاريس إضافتها إلى الخريطة أوسماند الأساسية.
|
||||
|
||||
• التزلج خرائط https://goo.gl/pX6DxJ معلومات حول أماكن اللهو التزلج ومسارات التزلج وكابل السكك الحديدية ومصاعد التزلج.
|
||||
|
||||
• الخارطة الملاحية https://goo.gl/0hEdxm نمط الخريطة الخاصة لعرض الملاحة البحرية علامات للملاحة البحرية الشرياني والقريبة من الشاطئ.
|
||||
|
||||
• موقف السيارات https://goo.gl/6JxQXF يساعدك على وضع علامة على موقع سيارتك واقفة وانظر كم من الوقت يترك إذا كان وقوف السيارات محدودة زمنياً.
|
||||
|
||||
لا تنزعج!
|
||||
|
||||
تغريد: https://twitter.com/osmandapp ألفيس بوك: https://www.facebook.com/osmandapp الموقع: http://osmand.net إذا كنت بحاجة إلى مساعدة مع تطبيق أوسماند، الرجاء الاتصال بفريق الدعم الخاص بنا: support@osmand.net.
|
||||
"</string>
|
||||
</resources>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
This file is manually maintained in res/values-en-rGB and should ONLY contain strings where a different spelling should be used for English as used in the United Kingdom
|
||||
-->
|
||||
|
||||
<string name="towards">towards</string>
|
||||
<string name="access_default_color">Default colour</string>
|
||||
<string name="rendering_value_walkingRoutesScopeOSMC_name">Colouring according to route scope</string>
|
||||
<string name="rendering_value_walkingRoutesOSMC_name">Colouring according to OSMC</string>
|
||||
|
|
|
@ -2488,7 +2488,7 @@
|
|||
<string name="poi_atm_no">Bankaŭtomato: ne</string>
|
||||
|
||||
<string name="poi_firepit">Lignofajrejo</string>
|
||||
<string name="poi_street_cabinet">Skatolo diskonektiga</string>
|
||||
<string name="poi_street_cabinet">Ŝranko distribua</string>
|
||||
|
||||
<string name="poi_fair_trade_yes">Justa komerco: jes</string>
|
||||
<string name="poi_fair_trade_no">Justa komerco: ne</string>
|
||||
|
@ -2542,8 +2542,51 @@
|
|||
<string name="poi_button_operated_no">Butonprema: ne</string>
|
||||
|
||||
<string name="poi_bicycle_repair_station">Bicikla mem-riparejo</string>
|
||||
<string name="poi_sport_free_flying">Glisparaŝutado</string>
|
||||
<string name="poi_free_flying_site_takeoff">Glisparaŝutado: elteriĝejo</string>
|
||||
<string name="poi_free_flying_site_landing">Glisparaŝutado: surteriĝejo</string>
|
||||
<string name="poi_free_flying_site_toplanding">Glisparaŝutado: surteriĝeja montpinto</string>
|
||||
<string name="poi_sport_free_flying">Libera flugado</string>
|
||||
<string name="poi_free_flying_site_takeoff">Libera flugado: elteriĝejo</string>
|
||||
<string name="poi_free_flying_site_landing">Libera flugado: surteriĝejo</string>
|
||||
<string name="poi_free_flying_site_toplanding">Libera flugado: surteriĝeja montpinto</string>
|
||||
<string name="poi_free_flying_site_towing">Libera flugado: elteriĝejo (vindaso)</string>
|
||||
<string name="poi_free_flying_site_training">Libera flugado: trejnejo</string>
|
||||
<string name="poi_free_flying_official_no">Oficiala ejo por libera flugado: ne</string>
|
||||
<string name="poi_free_flying_official_yes">Oficiala ejo por libera flugado: jes</string>
|
||||
<string name="poi_free_flying_paragliding_yes">Glisparaŝutado: jes</string>
|
||||
<string name="poi_free_flying_paragliding_no">Glisparaŝutado: ne</string>
|
||||
<string name="poi_free_flying_hanggliding_yes">Deltaplanado: jes</string>
|
||||
<string name="poi_free_flying_hanggliding_no">Deltaplanado: ne</string>
|
||||
<string name="poi_free_flying_rigid_yes">Rigid-flugila deltaplanado: jes</string>
|
||||
<string name="poi_free_flying_rigid_no">Rigid-flugila deltaplanado: ne</string>
|
||||
<string name="poi_free_flying_site_orientation_n">Direkto de liber-flugado: nordo</string>
|
||||
<string name="poi_free_flying_site_orientation_ne">Direkto de liber-flugado: nord-oriento</string>
|
||||
<string name="poi_free_flying_site_orientation_e">Direkto de liber-flugado: oriento</string>
|
||||
<string name="poi_free_flying_site_orientation_se">Direkto de liber-flugado: sud-oriento</string>
|
||||
<string name="poi_free_flying_site_orientation_s">Direkto de liber-flugado: sudo</string>
|
||||
<string name="poi_free_flying_site_orientation_sw">Direkto de liber-flugado: sud-okcidento</string>
|
||||
<string name="poi_free_flying_site_orientation_w">Direkto de liber-flugado: okcidento</string>
|
||||
<string name="poi_free_flying_site_orientation_nw">Direkto de liber-flugado: nord-okcidento</string>
|
||||
<string name="poi_free_flying_no_flight_time">Libera flugado malpermesita je</string>
|
||||
<string name="poi_free_flying_guest_guidelines_yes">Instrukcioj por liber-flugadaj gastoj: jes</string>
|
||||
<string name="poi_free_flying_guest_guidelines_no">Instrukcioj por liber-flugadaj gastoj: ne</string>
|
||||
|
||||
<string name="poi_solarium">Sunbrunigejo</string>
|
||||
|
||||
<string name="poi_sanitary_dump_station">Stacio de forigado de fekaĵoj</string>
|
||||
|
||||
<string name="poi_medical_system_western_yes">Medicina sistemo: okcidenta</string>
|
||||
<string name="poi_medical_system_chinese_yes">Medicina sistemo: ĉina tradicia</string>
|
||||
<string name="poi_medical_system_unknown_yes">Medicina sistemo: tradicia</string>
|
||||
<string name="poi_medical_system_ayurveeda_yes">Medicina sistemo: ajurvedo</string>
|
||||
<string name="poi_medical_system_kampo_yes">Medicina sistemo: kampō (ĉina medicino)</string>
|
||||
<string name="poi_medical_system_mongolian_yes">Medicina sistemo: mongola tradicia</string>
|
||||
<string name="poi_medical_system_tibetan_yes">Medicina sistemo: tibeta tradicia</string>
|
||||
<string name="poi_medical_system_sidda_yes">Medicina sistemo: siddha</string>
|
||||
<string name="poi_medical_system_unani_yes">Medicina sistemo: unani</string>
|
||||
|
||||
<string name="poi_nuclear_explosion_purpose_nuclear_weapons_related">Eksploda kialo: rilata al nuklea armilo</string>
|
||||
<string name="poi_nuclear_explosion_purpose_weapons_effects">Eksploda kialo: efektoj de armilo</string>
|
||||
<string name="poi_nuclear_explosion_purpose_safety_experiment">Eksploda kialo: eksperimento pri sendanĝereco</string>
|
||||
<string name="poi_nuclear_explosion_purpose_research_for_peaceful_applications">Eksploda kialo: esplorado por pacaj aplikoj</string>
|
||||
<string name="poi_nuclear_explosion_purpose_fundamental_science">Eksploda kialo: fundamenta esplorado</string>
|
||||
<string name="poi_nuclear_explosion_purpose_industrial_application_cavity_excavation">Eksploda kialo: industria apliko, fosado de truo</string>
|
||||
<string name="poi_nuclear_explosion_purpose_industrial_application_seismic_sounding">Eksploda kialo: industria apliko, tertrema bildigo</string>
|
||||
</resources>
|
||||
|
|
|
@ -324,7 +324,7 @@
|
|||
<string name="poi_university">Universidad</string>
|
||||
|
||||
<string name="poi_social_facility">Centro social</string>
|
||||
<string name="poi_courthouse">Juzgado</string>
|
||||
<string name="poi_courthouse">Tribunal de justicia</string>
|
||||
<string name="poi_prison">Cárcel</string>
|
||||
<string name="poi_register_office">Registro civil</string>
|
||||
<string name="poi_embassy">Embajada</string>
|
||||
|
|
|
@ -303,7 +303,7 @@
|
|||
<string name="poi_training">Centro de capacitación</string>
|
||||
<string name="poi_university">Universidad</string>
|
||||
<string name="poi_social_facility">Centro social</string>
|
||||
<string name="poi_courthouse">Juzgado</string>
|
||||
<string name="poi_courthouse">Tribunal de justicia</string>
|
||||
<string name="poi_prison">Prisión</string>
|
||||
<string name="poi_register_office">Registro civil</string>
|
||||
<string name="poi_embassy">Embajada</string>
|
||||
|
|
|
@ -2239,7 +2239,9 @@ Ora, sono disponibili solo {2} MB.</string>
|
|||
<string name="osm_live_subscription_settings">Impostazioni della sottoscrizione</string>
|
||||
<string name="osm_live_ask_for_purchase">Per favore acquista prima la sottoscrizione a OSM Live</string>
|
||||
|
||||
<string name="osm_live_header">La sottoscrizione abilita agli aggiornamenti orari per tutte le mappe del mondo. La maggior parte degli incassi ritornano alla comunità OSM ed è corrisposto per ogni contributo OSM. Nel caso ami OsmAnd e OSM e vuoi sostenerli è un perfetto modo per farlo.</string>
|
||||
<string name="osm_live_header">La sottoscrizione abilita agli aggiornamenti orari per tutte le mappe del mondo.
|
||||
La maggior parte degli incassi ritornano alla comunità OSM ed è corrisposto per ogni contributo OSM.
|
||||
Nel caso ami OsmAnd e OSM e vuoi sostenerli è un perfetto modo per farlo.</string>
|
||||
|
||||
<string name="upload_anonymously">Invia anonimamente</string>
|
||||
<string name="show_transparency_seekbar">Mostra la barra di ricerca trasparente</string>
|
||||
|
@ -2333,16 +2335,16 @@ Ora, sono disponibili solo {2} MB.</string>
|
|||
• Improved route guidance, voice prompting, and turn lane indication
|
||||
|
||||
|
||||
• Improved transport layer
|
||||
• Strato trasporti pubblici migliorato
|
||||
|
||||
|
||||
• Added more locales and now support regional locales
|
||||
• Aggiunto più lingue e ora sono supportati anche i dialetti
|
||||
|
||||
|
||||
• Many other improvements and bug fixes
|
||||
• Molte altre migliorie e correzioni di errori
|
||||
|
||||
|
||||
and more…
|
||||
e altro …
|
||||
"</string>
|
||||
<string name="dist_away_from_my_location">Cerca %1$s lontano</string>
|
||||
<string name="show_on_map">Mostra sulla mappa</string>
|
||||
|
|
|
@ -50,4 +50,14 @@
|
|||
<string name="poi_cheese">Sūrio parduotuvė</string>
|
||||
<string name="poi_chocolate">Šokolado parduotuvė</string>
|
||||
<string name="poi_coffee">Kavos parduotuvė</string>
|
||||
<string name="poi_convenience">Parduotuvėlė</string>
|
||||
<string name="poi_mall">Prekybos centras</string>
|
||||
<string name="poi_beverages">Gėrimų parduotuvė</string>
|
||||
<string name="poi_butcher">Mėsos turgus</string>
|
||||
<string name="poi_deli">Gurmaniško maisto parduotuvė</string>
|
||||
<string name="poi_farm">Ukininko parduotuvė</string>
|
||||
<string name="poi_greengrocer">Daržovių parduotuvė</string>
|
||||
<string name="poi_seafood">Jūros gėrybių parduotuvė</string>
|
||||
<string name="poi_confectionery">Konditerija</string>
|
||||
<string name="poi_ice_cream">Ledainė</string>
|
||||
</resources>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><resources>
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<resources>
|
||||
<string name="starting_point_too_far">Pradžios taškas yra per toli nuo artimiausio kelio.</string>
|
||||
<string name="shared_location">Bendrinta vieta</string>
|
||||
<string name="osmand_parking_warning">Dėmesio</string>
|
||||
|
@ -1456,7 +1457,21 @@
|
|||
<string name="osmo_start_service">OsMo paslauga</string>
|
||||
<string name="osmo_gpx_track_downloaded">OsMo įrašas %1$s parsiųstas.</string>
|
||||
<string name="osmo_group_by_invite">Prisijungti su pakvietimais</string>
|
||||
<string name="osmo_group_information_desc">" - Kurdami grupę suteikiate jai pavadinimą ir aprašymą.\n- Grupėje gali būti iki 8 asmenų.\n- Jei grupėje nebus jokios veiklos arba veikloje dalyvaus tik vienas asmuo dvi savaites, ji bus panaikinta.\n- Narystę grupėje galima apriboti pakvietimais, tačiau valdyti grupę bus galima tik iš administravimo konsolės.\n- Jei jums reikia sukuti grupę su kitokiais reikalavimais, susisiekite su http://osmo.mobi "</string>
|
||||
<string name="osmo_group_information_desc">"
|
||||
- Kurdami grupę suteikite jai pavadinimą ir aprašymą
|
||||
|
||||
- Iš programėlės sukuriamos tik paprasto tipo grupės. Daugiau informacijos https://osmo.mobi/g/new
|
||||
|
||||
- Interneto svetainėje galite valdyti grupę, pridėti pėdsakus ar taškus
|
||||
|
||||
- Mes nepritariame tik vieno naudotojo grupėms jei tai ne LV grupė
|
||||
|
||||
- Uždaros grupės ribojamos iki 8 narių
|
||||
|
||||
- Detalios nuostatos ir taisyklės visada prieinamos svetainėje OsMo.mobi
|
||||
|
||||
- Jei jums reikia išskirtinių sąlygų - susisiekite: osmo.mobi@gmail.com
|
||||
"</string>
|
||||
<string name="osmo_group_information">Perskaitykite prieš kurdami grupę!</string>
|
||||
<string name="osmo_not_signed_in">Prisijungti prie OsMo nepavyko</string>
|
||||
<string name="osmo_auth_error_short">Autorizavimas nepavyko</string>
|
||||
|
@ -2217,4 +2232,34 @@
|
|||
<string name="osm_live_support_region">Palaikomas regionas</string>
|
||||
<string name="osm_live_thanks">Ačiū kad užsiprenumeravote tiesioginius atnaujinimus!</string>
|
||||
<string name="osm_live_region_desc">Dalis jūsų paramos bus persiųsta OSM naudotojams, kurie teikia žemėlapio pakeitimus tame regione</string>
|
||||
</resources>
|
||||
<string name="route_stops_before">%1$s sustojimai iki</string>
|
||||
<string name="coords_search">Paieška pagal koordinates</string>
|
||||
<string name="advanced_coords_search">Platesnė paieška pagal koordinates</string>
|
||||
<string name="back_to_search">Atgal į paiešką</string>
|
||||
<string name="confirmation_to_delete_history_items">Ar norite ištrinti pasirinktus istorijos įrašus?</string>
|
||||
<string name="show_something_on_map">Rodyti %1$s žemėlapyje</string>
|
||||
<string name="release_2_4">"
|
||||
• Nauja labai galinga tekstinė paieška
|
||||
|
||||
|
||||
• Automobilio audio sistemos / garsiakalbio integracija per Bluetooth
|
||||
|
||||
|
||||
• Patobulintas maršruto nurodymas, balso nurodymai ir posūkio juostų pateikimas
|
||||
|
||||
|
||||
• Patobulintas transporto sluoksnio su maršrutais atvaizdavimas
|
||||
|
||||
|
||||
• Pridėta daugiau lokalių ir dabar jau palaikomos regioninės lokalės
|
||||
|
||||
|
||||
• Daugelis kitų patobulinimų ir ištaisytų klaidų
|
||||
|
||||
|
||||
ir dar daugiau…
|
||||
"</string>
|
||||
<string name="dist_away_from_my_location">Ieškoti %1$s spinduliu</string>
|
||||
<string name="show_on_map">Rodyti žemėlapyje</string>
|
||||
<string name="share_history_subject">" bendrinta iš OsmAnd"</string>
|
||||
</resources>
|
||||
|
|
|
@ -1665,7 +1665,7 @@ If you need help with OsmAnd application, please contact our support team: suppo
|
|||
<string name="left">to the left</string>
|
||||
<string name="front_left">left-forward</string>
|
||||
<string name="oclock">o\'clock</string>
|
||||
<string name="towards">towards</string>
|
||||
<string name="towards">toward</string>
|
||||
<string name="accuracy">Accuracy</string>
|
||||
<string name="altitude">Altitude</string>
|
||||
<string name="no_info">No info</string>
|
||||
|
|
|
@ -99,7 +99,7 @@ public class AvoidSpecificRoads {
|
|||
|
||||
protected String getText(RouteDataObject obj) {
|
||||
return RoutingHelper.formatStreetName(obj.getName(app.getSettings().MAP_PREFERRED_LOCALE.get()),
|
||||
obj.getRef(), obj.getDestinationName(app.getSettings().MAP_PREFERRED_LOCALE.get()));
|
||||
obj.getRef(), obj.getDestinationName(app.getSettings().MAP_PREFERRED_LOCALE.get()), app.getString(R.string.towards));
|
||||
}
|
||||
|
||||
public void showDialog(final MapActivity mapActivity) {
|
||||
|
|
|
@ -428,7 +428,7 @@ public class ExternalApiHelper {
|
|||
if (ni.directionInfo != null && ni.directionInfo.getTurnType() != null) {
|
||||
TurnType tt = ni.directionInfo.getTurnType();
|
||||
RouteDirectionInfo a = ni.directionInfo;
|
||||
result.putExtra(prefix + PARAM_NT_DIRECTION_NAME, RoutingHelper.formatStreetName(a.getStreetName(), a.getRef(), a.getDestinationName()));
|
||||
result.putExtra(prefix + PARAM_NT_DIRECTION_NAME, RoutingHelper.formatStreetName(a.getStreetName(), a.getRef(), a.getDestinationName(), ""));
|
||||
result.putExtra(prefix + PARAM_NT_DIRECTION_TURN, tt.toXmlString());
|
||||
if (tt.getLanes() != null) {
|
||||
result.putExtra(prefix + PARAM_NT_DIRECTION_LANES, Arrays.toString(tt.getLanes()));
|
||||
|
|
|
@ -261,7 +261,7 @@ public class RouteCalculationResult {
|
|||
}
|
||||
|
||||
String description = toString(turn, ctx) + " " + RoutingHelper.formatStreetName(info.getStreetName(),
|
||||
info.getRef(), info.getDestinationName());
|
||||
info.getRef(), info.getDestinationName(), ctx.getString(R.string.towards));
|
||||
String[] pointNames = s.getObject().getPointNames(s.getStartPointIndex());
|
||||
if(pointNames != null) {
|
||||
for (int t = 0; t < pointNames.length; t++) {
|
||||
|
|
|
@ -709,23 +709,50 @@ public class RoutingHelper {
|
|||
}
|
||||
|
||||
|
||||
public static String formatStreetName(String name, String ref, String destination) {
|
||||
if(destination != null && destination.length() > 0){
|
||||
if(ref != null && ref.length() > 0) {
|
||||
destination = ref + " " + destination;
|
||||
}
|
||||
return destination;
|
||||
} else if(name != null && name.length() > 0){
|
||||
if(ref != null && ref.length() > 0) {
|
||||
name = ref + " " + name;
|
||||
}
|
||||
return name;
|
||||
} else {
|
||||
if(ref == null) {
|
||||
return "";
|
||||
}
|
||||
return ref;
|
||||
public static String formatStreetName(String name, String ref, String destination, String towards) {
|
||||
//Original version returned:
|
||||
// 1. ref + " " + dest
|
||||
// 2. dest
|
||||
// 3. ref + " " + name
|
||||
// 4. name
|
||||
// 5. ref
|
||||
// 6. ""
|
||||
//Now returns: (ref)+((" ")+name)+((" ")+"toward "+dest)
|
||||
|
||||
String formattedStreetName = "";
|
||||
if (ref != null && ref.length() > 0) {
|
||||
formattedStreetName = ref;
|
||||
}
|
||||
if (name != null && name.length() > 0) {
|
||||
if (formattedStreetName.length() > 0) {
|
||||
formattedStreetName = formattedStreetName + " ";
|
||||
}
|
||||
formattedStreetName = formattedStreetName + name;
|
||||
}
|
||||
if (destination != null && destination.length() > 0) {
|
||||
if (formattedStreetName.length() > 0) {
|
||||
formattedStreetName = formattedStreetName + " ";
|
||||
}
|
||||
formattedStreetName = formattedStreetName + towards + " " + destination;
|
||||
}
|
||||
return formattedStreetName;
|
||||
|
||||
// if(destination != null && destination.length() > 0){
|
||||
// if(ref != null && ref.length() > 0) {
|
||||
// destination = ref + " " + destination;
|
||||
// }
|
||||
// return destination;
|
||||
// } else if(name != null && name.length() > 0){
|
||||
// if(ref != null && ref.length() > 0) {
|
||||
// name = ref + " " + name;
|
||||
// }
|
||||
// return name;
|
||||
// } else {
|
||||
// if(ref == null) {
|
||||
// return "";
|
||||
// }
|
||||
// return ref;
|
||||
// }
|
||||
}
|
||||
|
||||
// protected boolean isDistanceLess(float currentSpeed, double dist, double etalon, float defSpeed){
|
||||
|
@ -750,14 +777,14 @@ public class RoutingHelper {
|
|||
if(next != null) {
|
||||
next[0] = n.directionInfo.getTurnType();
|
||||
}
|
||||
return formatStreetName(nm, rf, dn);
|
||||
return formatStreetName(nm, rf, dn, app.getString(R.string.towards));
|
||||
}
|
||||
RouteSegmentResult rs = getCurrentSegmentResult();
|
||||
if(rs != null) {
|
||||
String nm = rs.getObject().getName(settings.MAP_PREFERRED_LOCALE.get());
|
||||
String rf = rs.getObject().getRef();
|
||||
String dn = rs.getObject().getDestinationName(settings.MAP_PREFERRED_LOCALE.get());
|
||||
return formatStreetName(nm, rf, dn);
|
||||
return formatStreetName(nm, rf, dn, app.getString(R.string.towards));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,45 @@
|
|||
package net.osmand.plus.search;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.Location;
|
||||
import net.osmand.OsmAndCollator;
|
||||
import net.osmand.ResultMatcher;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.data.PointDescription;
|
||||
import net.osmand.osm.AbstractPoiType;
|
||||
import net.osmand.plus.AppInitializer;
|
||||
import net.osmand.plus.AppInitializer.AppInitializeListener;
|
||||
import net.osmand.plus.GPXUtilities;
|
||||
import net.osmand.plus.GPXUtilities.GPXFile;
|
||||
import net.osmand.plus.GPXUtilities.WptPt;
|
||||
import net.osmand.plus.LockableViewPager;
|
||||
import net.osmand.plus.OsmAndFormatter;
|
||||
import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener;
|
||||
import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.helpers.SearchHistoryHelper;
|
||||
import net.osmand.plus.helpers.SearchHistoryHelper.HistoryEntry;
|
||||
import net.osmand.plus.poi.PoiUIFilter;
|
||||
import net.osmand.plus.search.QuickSearchHelper.SearchHistoryAPI;
|
||||
import net.osmand.search.SearchUICore;
|
||||
import net.osmand.search.SearchUICore.SearchResultCollection;
|
||||
import net.osmand.search.core.ObjectType;
|
||||
import net.osmand.search.core.SearchCoreAPI;
|
||||
import net.osmand.search.core.SearchCoreFactory.SearchAmenityTypesAPI;
|
||||
import net.osmand.search.core.SearchPhrase;
|
||||
import net.osmand.search.core.SearchResult;
|
||||
import net.osmand.search.core.SearchSettings;
|
||||
import net.osmand.search.core.SearchWord;
|
||||
import net.osmand.util.Algorithms;
|
||||
import net.osmand.util.MapUtils;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
|
@ -34,46 +74,6 @@ import android.widget.ListView;
|
|||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.Location;
|
||||
import net.osmand.ResultMatcher;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.data.PointDescription;
|
||||
import net.osmand.osm.AbstractPoiType;
|
||||
import net.osmand.plus.AppInitializer;
|
||||
import net.osmand.plus.AppInitializer.AppInitializeListener;
|
||||
import net.osmand.plus.GPXUtilities;
|
||||
import net.osmand.plus.GPXUtilities.GPXFile;
|
||||
import net.osmand.plus.GPXUtilities.WptPt;
|
||||
import net.osmand.plus.LockableViewPager;
|
||||
import net.osmand.plus.OsmAndFormatter;
|
||||
import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener;
|
||||
import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.helpers.SearchHistoryHelper;
|
||||
import net.osmand.plus.helpers.SearchHistoryHelper.HistoryEntry;
|
||||
import net.osmand.plus.poi.PoiUIFilter;
|
||||
import net.osmand.plus.search.QuickSearchHelper.SearchHistoryAPI;
|
||||
import net.osmand.search.SearchUICore;
|
||||
import net.osmand.search.SearchUICore.SearchResultCollection;
|
||||
import net.osmand.search.core.ObjectType;
|
||||
import net.osmand.search.core.SearchCoreAPI;
|
||||
import net.osmand.search.core.SearchCoreFactory.SearchAmenityTypesAPI;
|
||||
import net.osmand.search.core.SearchPhrase;
|
||||
import net.osmand.search.core.SearchResult;
|
||||
import net.osmand.search.core.SearchSettings;
|
||||
import net.osmand.search.core.SearchWord;
|
||||
import net.osmand.util.Algorithms;
|
||||
import net.osmand.util.MapUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class QuickSearchDialogFragment extends DialogFragment implements OsmAndCompassListener, OsmAndLocationListener {
|
||||
|
||||
public static final String TAG = "QuickSearchDialogFragment";
|
||||
|
@ -699,13 +699,13 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
try {
|
||||
SearchResultCollection res = searchUICore.shallowSearch(SearchHistoryAPI.class,
|
||||
"", null);
|
||||
List<QuickSearchListItem> rows = new ArrayList<>();
|
||||
if (res != null) {
|
||||
List<QuickSearchListItem> rows = new ArrayList<>();
|
||||
for (SearchResult sr : res.getCurrentSearchResults()) {
|
||||
rows.add(new QuickSearchListItem(app, sr));
|
||||
}
|
||||
historySearchFragment.updateListAdapter(rows, false);
|
||||
}
|
||||
historySearchFragment.updateListAdapter(rows, false);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
app.showToastMessage(e.getMessage());
|
||||
|
@ -766,7 +766,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
|
||||
if (paused) {
|
||||
if (results.size() > 0) {
|
||||
getResultCollection().getCurrentSearchResults().addAll(results);
|
||||
getResultCollection().addSearchResults(results, true, true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -785,7 +785,6 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
apiResults = regionCollection.getCurrentSearchResults();
|
||||
} else {
|
||||
apiResults = results;
|
||||
searchUICore.sortSearchResults(phrase, apiResults);
|
||||
}
|
||||
|
||||
regionResultApi = null;
|
||||
|
@ -798,9 +797,12 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
if (!paused) {
|
||||
boolean appended = false;
|
||||
if (getResultCollection() == null || getResultCollection().getPhrase() != phrase) {
|
||||
setResultCollection(new SearchResultCollection(apiResults, phrase));
|
||||
SearchResultCollection resCollection =
|
||||
new SearchResultCollection(phrase);
|
||||
resCollection.addSearchResults(results, true, true);
|
||||
setResultCollection(resCollection);
|
||||
} else {
|
||||
getResultCollection().getCurrentSearchResults().addAll(apiResults);
|
||||
getResultCollection().addSearchResults(apiResults, false, true );
|
||||
appended = true;
|
||||
}
|
||||
if (!hasRegionCollection) {
|
||||
|
@ -812,22 +814,17 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
break;
|
||||
case SEARCH_API_REGION_FINISHED:
|
||||
regionResultApi = (SearchCoreAPI) object.object;
|
||||
|
||||
final List<SearchResult> regionResults = new ArrayList<>(results);
|
||||
final SearchPhrase regionPhrase = object.requiredSearchPhrase;
|
||||
searchUICore.sortSearchResults(regionPhrase, regionResults);
|
||||
|
||||
regionResultCollection = new SearchResultCollection(regionPhrase);
|
||||
regionResultCollection.addSearchResults(results, true, true);
|
||||
app.runInUIThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!paused) {
|
||||
boolean appended = getResultCollection() != null && getResultCollection().getPhrase() == regionPhrase;
|
||||
regionResultCollection = new SearchResultCollection(regionResults, regionPhrase);
|
||||
if (appended) {
|
||||
List<SearchResult> res = new ArrayList<>(getResultCollection().getCurrentSearchResults());
|
||||
res.addAll(regionResults);
|
||||
SearchResultCollection resCollection = new SearchResultCollection(res, regionPhrase);
|
||||
searchUICore.filterSearchDuplicateResults(regionPhrase, resCollection.getCurrentSearchResults());
|
||||
SearchResultCollection resCollection =
|
||||
getResultCollection().combineWithCollection(regionResultCollection, false, true);
|
||||
updateSearchResult(resCollection, true);
|
||||
} else {
|
||||
updateSearchResult(regionResultCollection, false);
|
||||
|
|
|
@ -331,7 +331,7 @@ public class MapInfoWidgetsFactory {
|
|||
showNextTurn = true;
|
||||
RouteDirectionInfo next = routingHelper.getRouteDirections().get(di);
|
||||
type[0] = next.getTurnType();
|
||||
text = RoutingHelper.formatStreetName(next.getStreetName(), next.getRef(), next.getDestinationName());
|
||||
text = RoutingHelper.formatStreetName(next.getStreetName(), next.getRef(), next.getDestinationName(), map.getMyApplication().getString(R.string.towards));
|
||||
// if (next.distance > 0) {
|
||||
// text += " " + OsmAndFormatter.getFormattedDistance(next.distance, map.getMyApplication());
|
||||
// }
|
||||
|
@ -346,7 +346,7 @@ public class MapInfoWidgetsFactory {
|
|||
RouteDataObject rt = locationProvider.getLastKnownRouteSegment();
|
||||
if (rt != null) {
|
||||
text = RoutingHelper.formatStreetName(rt.getName(settings.MAP_PREFERRED_LOCALE.get()),
|
||||
rt.getRef(), rt.getDestinationName(settings.MAP_PREFERRED_LOCALE.get()));
|
||||
rt.getRef(), rt.getDestinationName(settings.MAP_PREFERRED_LOCALE.get()), map.getMyApplication().getString(R.string.towards));
|
||||
}
|
||||
if (text == null) {
|
||||
text = "";
|
||||
|
|
Loading…
Reference in a new issue