This commit is contained in:
Alexey Kulish 2018-05-29 14:15:45 +03:00
parent c9f8057b13
commit fd16da1f81
2 changed files with 10 additions and 2 deletions

View file

@ -313,6 +313,9 @@ public abstract class OsmandMapLayer {
}
}
public void layerOnPreExecute() {
}
public void layerOnPostExecute() {
}
@ -350,6 +353,7 @@ public abstract class OsmandMapLayer {
@Override
protected void onPreExecute() {
currentTask = this;
layerOnPreExecute();
}
@Override

View file

@ -94,16 +94,20 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
return super.isInterrupted();
}
@Override
public void layerOnPreExecute() {
calculatedFilters = new TreeSet<>(filters);
}
@Override
public void layerOnPostExecute() {
filters = calculatedFilters;
activity.getMapView().refreshMap();
}
@Override
protected List<Amenity> calculateResult(RotatedTileBox tileBox) {
QuadRect latLonBounds = tileBox.getLatLonBounds();
calculatedFilters = filters;
if (calculatedFilters.isEmpty() || latLonBounds == null) {
return new ArrayList<>();
}