diff --git a/OsmAnd/src/net/osmand/plus/AmenityIndexRepository.java b/OsmAnd/src/net/osmand/plus/AmenityIndexRepository.java index d13d2afced..8803c09da4 100644 --- a/OsmAnd/src/net/osmand/plus/AmenityIndexRepository.java +++ b/OsmAnd/src/net/osmand/plus/AmenityIndexRepository.java @@ -27,5 +27,9 @@ public interface AmenityIndexRepository { public void evaluateCachedAmenities(double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, int zoom, PoiFilter filter, ResultMatcher matcher); + + public boolean hasChange(); + + public void clearChange(); } diff --git a/OsmAnd/src/net/osmand/plus/AmenityIndexRepositoryBinary.java b/OsmAnd/src/net/osmand/plus/AmenityIndexRepositoryBinary.java index 054697552a..ff1543405e 100644 --- a/OsmAnd/src/net/osmand/plus/AmenityIndexRepositoryBinary.java +++ b/OsmAnd/src/net/osmand/plus/AmenityIndexRepositoryBinary.java @@ -39,6 +39,16 @@ public class AmenityIndexRepositoryBinary implements AmenityIndexRepository { } + @Override + public boolean hasChange() { + return false; //no change ever + } + + @Override + public void clearChange() { + //nothing to do + } + @Override public boolean checkContains(double latitude, double longitude) { return index.containsPoiData(latitude, longitude); diff --git a/OsmAnd/src/net/osmand/plus/AmenityIndexRepositoryOdb.java b/OsmAnd/src/net/osmand/plus/AmenityIndexRepositoryOdb.java index 175a696b0c..727dc5ae5e 100644 --- a/OsmAnd/src/net/osmand/plus/AmenityIndexRepositoryOdb.java +++ b/OsmAnd/src/net/osmand/plus/AmenityIndexRepositoryOdb.java @@ -43,6 +43,8 @@ public class AmenityIndexRepositoryOdb extends BaseLocationIndexRepository searchAmenities(int stop, int sleft, int sbottom, int sright, int zoom, PoiFilter filter, List amenities, ResultMatcher matcher){ @@ -177,11 +179,14 @@ public class AmenityIndexRepositoryOdb extends BaseLocationIndexRepository= startZoom || nightMode.isForce()) { + if (view.getZoom() >= startZoom) { objects.clear(); resourceManager.searchAmenitiesAsync(latLonBounds.top, latLonBounds.left, latLonBounds.bottom, latLonBounds.right, view.getZoom(), filter, objects); int r = getRadiusPoi(view.getZoom());