This commit is contained in:
Alexey Kulish 2016-06-30 16:57:28 +03:00
parent b4da4f7663
commit 6b6ae6bdaf
6 changed files with 29 additions and 15 deletions

View file

@ -96,7 +96,7 @@ public class SearchCore {
public List<SearchResult> search(SearchPhrase phrase, int radiusLevel, SearchCallback callback,
List<SearchResult> existingSearchResults) {
// (search streets in neighboor cities for radiusLevel > 2)
if((isLastWordPoi(phrase) || isNoSelectedType(phrase) || raidusLevel >= 2
if((isLastWordPoi(phrase) || isNoSelectedType(phrase) || radiusLevel >= 2
) && !(phrase.isEmpty())) {
int typedLettersInStreet = 1;
QuadRect bbox = getBBoxToSearch(20000 * typedLettersInStreet, radiusLevel, phrase.getLastTokenLocation());

View file

@ -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.Building;
@ -6,6 +6,13 @@ import net.osmand.core.jni.OsmAndCoreJNI;
import net.osmand.core.jni.Street;
import net.osmand.core.jni.StreetGroup;
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 {

View file

@ -0,0 +1,7 @@
package net.osmand.core.samples.android.sample1.search.objects;
/**
* Created by Alexey Kulish on 30/06/16.
*/
public class PoiTypeObject {
}

View file

@ -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);
}
}

View file

@ -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);
}
}

View file

@ -2,17 +2,17 @@ package net.osmand.core.samples.android.sample1.search.tokens;
import net.osmand.core.samples.android.sample1.search.objects.SearchObject;
public class ObjectSearchToken extends SearchToken {
public class ObjectToken extends SearchToken {
private boolean suggestion = true;
public ObjectSearchToken(SearchToken searchToken, SearchObject searchObject, boolean suggestion) {
super(TokenType.SEARCH_OBJECT, searchToken.getStartIndex(), searchToken.getQueryText(), searchObject);
public ObjectToken(SearchToken searchToken, SearchObject searchObject, boolean suggestion) {
super(TokenType.SEARCH_OBJECT, searchToken.getStartIndex(), searchToken.getPlainText(), searchObject);
this.suggestion = suggestion;
}
public ObjectSearchToken(int startIndex, String queryText, SearchObject searchObject, boolean suggestion) {
super(TokenType.SEARCH_OBJECT, startIndex, queryText, searchObject);
public ObjectToken(int startIndex, String plainText, SearchObject searchObject, boolean suggestion) {
super(TokenType.SEARCH_OBJECT, startIndex, plainText, searchObject);
this.suggestion = suggestion;
}