LabelLayer: prevent running worker when disabled (caused a loop) (#374)

This commit is contained in:
Wolfgang Schramm 2017-07-11 16:03:42 +02:00 committed by Emux
parent 9f7fe2577b
commit a6aa2b2388

View File

@ -1,5 +1,6 @@
/*
* Copyright 2012, 2013 Hannes Janetzek
* Copyright 2017 Wolfgang Schramm
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@ -99,6 +100,9 @@ public class LabelLayer extends Layer implements Map.UpdateListener, TileManager
if (event == Map.CLEAR_EVENT)
mWorker.cancel(true);
if (!isEnabled())
return;
if (event == Map.POSITION_EVENT)
mWorker.submit(MAX_RELABEL_DELAY);
}