From 6f3b55061a8c1f059f212d8326446cd47df36343 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Tue, 29 May 2018 14:15:45 +0300 Subject: [PATCH] Fix #5502 --- OsmAnd/src/net/osmand/plus/views/OsmandMapLayer.java | 4 ++++ OsmAnd/src/net/osmand/plus/views/POIMapLayer.java | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/OsmandMapLayer.java b/OsmAnd/src/net/osmand/plus/views/OsmandMapLayer.java index 5969853e95..767e0cd10e 100644 --- a/OsmAnd/src/net/osmand/plus/views/OsmandMapLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/OsmandMapLayer.java @@ -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 diff --git a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java index 57dd52e656..0df66923c1 100644 --- a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java @@ -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 calculateResult(RotatedTileBox tileBox) { QuadRect latLonBounds = tileBox.getLatLonBounds(); - calculatedFilters = filters; if (calculatedFilters.isEmpty() || latLonBounds == null) { return new ArrayList<>(); }