Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
a9e7c5682f
6 changed files with 29 additions and 15 deletions
|
@ -96,7 +96,7 @@ public class SearchCore {
|
||||||
public List<SearchResult> search(SearchPhrase phrase, int radiusLevel, SearchCallback callback,
|
public List<SearchResult> search(SearchPhrase phrase, int radiusLevel, SearchCallback callback,
|
||||||
List<SearchResult> existingSearchResults) {
|
List<SearchResult> existingSearchResults) {
|
||||||
// (search streets in neighboor cities for radiusLevel > 2)
|
// (search streets in neighboor cities for radiusLevel > 2)
|
||||||
if((isLastWordPoi(phrase) || isNoSelectedType(phrase) || raidusLevel >= 2
|
if((isLastWordPoi(phrase) || isNoSelectedType(phrase) || radiusLevel >= 2
|
||||||
) && !(phrase.isEmpty())) {
|
) && !(phrase.isEmpty())) {
|
||||||
int typedLettersInStreet = 1;
|
int typedLettersInStreet = 1;
|
||||||
QuadRect bbox = getBBoxToSearch(20000 * typedLettersInStreet, radiusLevel, phrase.getLastTokenLocation());
|
QuadRect bbox = getBBoxToSearch(20000 * typedLettersInStreet, radiusLevel, phrase.getLastTokenLocation());
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package net.osmand.core.samples.android.sample1.search.objects;
|
package net.osmand.core.samples.android.sample1.search;
|
||||||
|
|
||||||
import net.osmand.core.jni.Address;
|
import net.osmand.core.jni.Address;
|
||||||
import net.osmand.core.jni.Building;
|
import net.osmand.core.jni.Building;
|
||||||
|
@ -6,6 +6,13 @@ import net.osmand.core.jni.OsmAndCoreJNI;
|
||||||
import net.osmand.core.jni.Street;
|
import net.osmand.core.jni.Street;
|
||||||
import net.osmand.core.jni.StreetGroup;
|
import net.osmand.core.jni.StreetGroup;
|
||||||
import net.osmand.core.jni.StreetIntersection;
|
import net.osmand.core.jni.StreetIntersection;
|
||||||
|
import net.osmand.core.samples.android.sample1.search.objects.BuildingSearchObject;
|
||||||
|
import net.osmand.core.samples.android.sample1.search.objects.CitySearchObject;
|
||||||
|
import net.osmand.core.samples.android.sample1.search.objects.PostcodeSearchObject;
|
||||||
|
import net.osmand.core.samples.android.sample1.search.objects.SearchPositionObject;
|
||||||
|
import net.osmand.core.samples.android.sample1.search.objects.StreetIntersectionSearchObject;
|
||||||
|
import net.osmand.core.samples.android.sample1.search.objects.StreetSearchObject;
|
||||||
|
import net.osmand.core.samples.android.sample1.search.objects.VillageSearchObject;
|
||||||
|
|
||||||
public class SearchObjectsHelper {
|
public class SearchObjectsHelper {
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
package net.osmand.core.samples.android.sample1.search.objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Alexey Kulish on 30/06/16.
|
||||||
|
*/
|
||||||
|
public class PoiTypeObject {
|
||||||
|
}
|
|
@ -1,8 +0,0 @@
|
||||||
package net.osmand.core.samples.android.sample1.search.tokens;
|
|
||||||
|
|
||||||
public class NameFilterSearchToken extends SearchToken {
|
|
||||||
|
|
||||||
public NameFilterSearchToken(int startIndex, String queryText) {
|
|
||||||
super(TokenType.NAME_FILTER, startIndex, queryText, null);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
package net.osmand.core.samples.android.sample1.search.tokens;
|
||||||
|
|
||||||
|
public class NameFilterToken extends SearchToken {
|
||||||
|
|
||||||
|
public NameFilterToken(int startIndex, String plainText) {
|
||||||
|
super(TokenType.NAME_FILTER, startIndex, plainText, null);
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,17 +2,17 @@ package net.osmand.core.samples.android.sample1.search.tokens;
|
||||||
|
|
||||||
import net.osmand.core.samples.android.sample1.search.objects.SearchObject;
|
import net.osmand.core.samples.android.sample1.search.objects.SearchObject;
|
||||||
|
|
||||||
public class ObjectSearchToken extends SearchToken {
|
public class ObjectToken extends SearchToken {
|
||||||
|
|
||||||
private boolean suggestion = true;
|
private boolean suggestion = true;
|
||||||
|
|
||||||
public ObjectSearchToken(SearchToken searchToken, SearchObject searchObject, boolean suggestion) {
|
public ObjectToken(SearchToken searchToken, SearchObject searchObject, boolean suggestion) {
|
||||||
super(TokenType.SEARCH_OBJECT, searchToken.getStartIndex(), searchToken.getQueryText(), searchObject);
|
super(TokenType.SEARCH_OBJECT, searchToken.getStartIndex(), searchToken.getPlainText(), searchObject);
|
||||||
this.suggestion = suggestion;
|
this.suggestion = suggestion;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ObjectSearchToken(int startIndex, String queryText, SearchObject searchObject, boolean suggestion) {
|
public ObjectToken(int startIndex, String plainText, SearchObject searchObject, boolean suggestion) {
|
||||||
super(TokenType.SEARCH_OBJECT, startIndex, queryText, searchObject);
|
super(TokenType.SEARCH_OBJECT, startIndex, plainText, searchObject);
|
||||||
this.suggestion = suggestion;
|
this.suggestion = suggestion;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue