API: SymbolItem add set(x,y,symbol,billboard)
This commit is contained in:
parent
61e9deb101
commit
eada09d060
@ -450,12 +450,13 @@ public class VectorTileLoader extends TileLoader implements IRenderTheme.Callbac
|
||||
Log.d(TAG, "missing symbol for " + mElement.tags.asString());
|
||||
return;
|
||||
}
|
||||
SymbolItem it = SymbolItem.pool.get();
|
||||
it.x = mElement.points[0];
|
||||
it.y = mElement.points[1];
|
||||
it.texRegion = symbol.texture;
|
||||
it.billboard = true;
|
||||
mTile.addSymbol(it);
|
||||
for (int i = 0, n = mElement.getNumPoints(); i < n; i++) {
|
||||
PointF p = mElement.getPoint(i);
|
||||
|
||||
SymbolItem it = SymbolItem.pool.get();
|
||||
it.set(p.x, p.y, symbol.texture, true);
|
||||
mTile.addSymbol(it);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -20,7 +20,6 @@ import org.oscim.renderer.atlas.TextureRegion;
|
||||
import org.oscim.utils.pool.Inlist;
|
||||
import org.oscim.utils.pool.SyncPool;
|
||||
|
||||
|
||||
public class SymbolItem extends Inlist<SymbolItem> {
|
||||
|
||||
public final static SyncPool<SymbolItem> pool = new SyncPool<SymbolItem>() {
|
||||
@ -48,4 +47,18 @@ public class SymbolItem extends Inlist<SymbolItem> {
|
||||
public Bitmap bitmap;
|
||||
public Point offset;
|
||||
|
||||
public void set(float x, float y, TextureRegion texture, boolean billboard) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.texRegion = texture;
|
||||
this.billboard = billboard;
|
||||
}
|
||||
|
||||
public void set(float x, float y, Bitmap bitmap, boolean billboard) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.bitmap = bitmap;
|
||||
this.billboard = billboard;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user