Map: simplify updateMap

This commit is contained in:
Emux 2019-02-21 13:07:24 +02:00
parent 31077cb637
commit 7cfbe1c115
No known key found for this signature in database
GPG Key ID: 64ED9980896038C3
4 changed files with 27 additions and 7 deletions

View File

@ -1,6 +1,6 @@
/*
* Copyright 2012 Hannes Janetzek
* Copyright 2016-2018 devemux86
* Copyright 2016-2019 devemux86
* Copyright 2018-2019 Gustl22
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
@ -234,6 +234,11 @@ public class MapView extends GLSurfaceView {
}
};
@Override
public void updateMap() {
updateMap(true);
}
@Override
public void updateMap(boolean redraw) {
synchronized (mRedrawCb) {

View File

@ -1,6 +1,6 @@
/*
* Copyright 2013 Hannes Janetzek
* Copyright 2016-2018 devemux86
* Copyright 2016-2019 devemux86
* Copyright 2018-2019 Gustl22
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
@ -184,6 +184,11 @@ public abstract class GdxMap implements ApplicationListener {
}
};
@Override
public void updateMap() {
updateMap(true);
}
@Override
public void updateMap(boolean forceRender) {
synchronized (mRedrawCb) {

View File

@ -1,5 +1,6 @@
/*
* Copyright 2017 Longri
* Copyright 2019 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
@ -69,6 +70,11 @@ public class MapAdapter extends Map implements Map.UpdateListener {
}
};
@Override
public void updateMap() {
updateMap(true);
}
@Override
public void updateMap(boolean forceRender) {
synchronized (mRedrawCb) {
@ -81,7 +87,6 @@ public class MapAdapter extends Map implements Map.UpdateListener {
}
}
@Override
public void render() {
synchronized (mRedrawCb) {

View File

@ -2,7 +2,7 @@
* Copyright 2013 Hannes Janetzek
* Copyright 2016 Andrey Novikov
* Copyright 2016 Stephan Leuschner
* Copyright 2016-2018 devemux86
* Copyright 2016-2019 devemux86
* Copyright 2016 Longri
* Copyright 2018 Gustl22
*
@ -171,9 +171,7 @@ public abstract class Map implements TaskQueue {
/**
* Create OsmTileLayer with given TileSource and
* set as base map (layer 1)
* <p>
* TODO deprecate
* set as base map (layer 1).
*/
public VectorTileLayer setBaseMap(TileSource tileSource) {
VectorTileLayer l = new OsmTileLayer(this);
@ -236,6 +234,13 @@ public abstract class Map implements TaskQueue {
mAsyncExecutor.dispose();
}
/**
* Request call to onUpdate for all layers. This function can
* be called from any thread. Request will be handled on main
* thread.
*/
public abstract void updateMap();
/**
* Request call to onUpdate for all layers. This function can
* be called from any thread. Request will be handled on main