add filterPoiByType()
This commit is contained in:
parent
e32591c99e
commit
3e9ef3914b
1 changed files with 26 additions and 1 deletions
|
@ -204,6 +204,7 @@ public class SearchUICore {
|
||||||
for (SearchResult rs : lstUnique) {
|
for (SearchResult rs : lstUnique) {
|
||||||
same = sameSearchResult(rs, r);
|
same = sameSearchResult(rs, r);
|
||||||
if (same) {
|
if (same) {
|
||||||
|
filterPoiByType(rs, r, lst);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -218,6 +219,24 @@ public class SearchUICore {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void filterPoiByType(SearchResult r1, SearchResult r2, List<SearchResult> list) {
|
||||||
|
if (r1.object instanceof Amenity) {
|
||||||
|
|
||||||
|
Amenity a1 = (Amenity) r1.object;
|
||||||
|
Amenity a2 = (Amenity) r2.object;
|
||||||
|
|
||||||
|
if (!(a2.getSubType().equals("building") || a2.getSubType().contains("internet"))
|
||||||
|
&& (a1.getSubType().equals("building") || a1.getSubType().contains("internet"))) {
|
||||||
|
|
||||||
|
int index = list.indexOf(r1);
|
||||||
|
|
||||||
|
if (list.contains(r1)) {
|
||||||
|
list.set(index, r2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public boolean sameSearchResult(SearchResult r1, SearchResult r2) {
|
public boolean sameSearchResult(SearchResult r1, SearchResult r2) {
|
||||||
if (r1.location != null && r2.location != null &&
|
if (r1.location != null && r2.location != null &&
|
||||||
!ObjectType.isTopVisible(r1.objectType) && !ObjectType.isTopVisible(r2.objectType)) {
|
!ObjectType.isTopVisible(r1.objectType) && !ObjectType.isTopVisible(r2.objectType)) {
|
||||||
|
@ -244,10 +263,16 @@ public class SearchUICore {
|
||||||
String type2 = a2.getType().getKeyName();
|
String type2 = a2.getType().getKeyName();
|
||||||
String subType1 = a1.getSubType();
|
String subType1 = a1.getSubType();
|
||||||
String subType2 = a2.getSubType();
|
String subType2 = a2.getSubType();
|
||||||
if(a1.getId().longValue() == a2.getId().longValue() && (subType1.equals("building") || subType2.equals("building"))) {
|
|
||||||
|
if (a1.getId().longValue() == a2.getId().longValue()
|
||||||
|
&& ((subType1.equals("building") || subType2.equals("building")))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!type1.equals(type2)) {
|
if (!type1.equals(type2)) {
|
||||||
|
if (a1.getId().longValue() == a2.getId().longValue() && subType1.contains("internet")
|
||||||
|
|| subType2.contains("internet")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (type1.equals("natural")) {
|
if (type1.equals("natural")) {
|
||||||
|
|
Loading…
Reference in a new issue