clear ItemizedOverlay

This commit is contained in:
Hannes Janetzek 2013-02-01 04:33:51 +01:00
parent 019c39d8b8
commit be67647bdd
2 changed files with 16 additions and 1 deletions

View File

@ -112,6 +112,13 @@ public abstract class ItemizedOverlay<Item extends OverlayItem> extends Overlay
int numVisible = 0;
synchronized (lock) {
if (mItems == null) {
if (layers.textureLayers != null) {
layers.clear();
newData = true;
}
return;
}
// check changes
for (InternalItem it = mItems; it != null; it = it.next) {

View File

@ -71,13 +71,21 @@ public abstract class BasicOverlay extends RenderOverlay {
@Override
public void compile() {
int newSize = layers.getSize();
if (newSize == 0) {
BufferObject.release(vbo);
vbo = null;
isReady = false;
return;
}
if (vbo == null) {
vbo = BufferObject.get(0);
if (vbo == null)
return;
}
int newSize = layers.getSize();
if (newSize > 0) {
if (GLRenderer.uploadLayers(layers, vbo, newSize, true))
isReady = true;