Merge pull request #4864 from osmandapp/PaulsBrnach

Pauls brnach
This commit is contained in:
Alexey 2017-12-19 15:20:28 +03:00 committed by GitHub
commit d0311a8d2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -86,5 +86,4 @@ public class Street extends MapObject {
} }
return nm; return nm;
} }
} }

View file

@ -7,6 +7,7 @@ import net.osmand.ResultMatcher;
import net.osmand.binary.BinaryMapIndexReader; import net.osmand.binary.BinaryMapIndexReader;
import net.osmand.data.Amenity; import net.osmand.data.Amenity;
import net.osmand.data.LatLon; import net.osmand.data.LatLon;
import net.osmand.data.Street;
import net.osmand.osm.MapPoiTypes; import net.osmand.osm.MapPoiTypes;
import net.osmand.search.core.CustomSearchPoiFilter; import net.osmand.search.core.CustomSearchPoiFilter;
import net.osmand.search.core.ObjectType; import net.osmand.search.core.ObjectType;
@ -183,6 +184,13 @@ public class SearchUICore {
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) {
if (r1.objectType == r2.objectType) {
if (r1.objectType == ObjectType.STREET) {
Street st1 = (Street) r1.object;
Street st2 = (Street) r2.object;
return st1.getLocation().equals(st2.getLocation());
}
}
Amenity a1 = null; Amenity a1 = null;
if (r1.object instanceof Amenity) { if (r1.object instanceof Amenity) {
a1 = (Amenity) r1.object; a1 = (Amenity) r1.object;