use of org.oscim.android.canvas.AndroidBitmap in project android_packages_apps_GmsCore by microg.
the class BackendMapView method initialize.
private void initialize() {
ITileCache cache = new SharedTileCache(getContext());
cache.setCacheSize(512 * (1 << 10));
OSciMap4TileSource tileSource = new OSciMap4TileSource();
tileSource.setCache(cache);
VectorTileLayer baseLayer = map().setBaseMap(tileSource);
Layers layers = map().layers();
layers.add(drawables = new ClearableVectorLayer(map()));
layers.add(labels = new LabelLayer(map(), baseLayer));
layers.add(buildings = new BuildingLayer(map(), baseLayer));
layers.add(items = new ItemizedLayer<MarkerItem>(map(), new MarkerSymbol(new AndroidBitmap(BitmapFactory.decodeResource(getContext().getResources(), R.drawable.nop)), 0.5F, 1)));
map().setTheme(MicrogThemes.DEFAULT);
}
use of org.oscim.android.canvas.AndroidBitmap in project android_packages_apps_GmsCore by microg.
the class MarkerImpl method getMarkerItem.
@Override
public MarkerItem getMarkerItem(Context context) {
if (removed)
return null;
MarkerItem item = new MarkerItem(getId(), getTitle(), getSnippet(), GmsMapsTypeHelper.fromLatLng(getPosition()));
BitmapDescriptorImpl icon = this.icon;
if (icon == null)
icon = DefaultBitmapDescriptor.DEFAULT_DESCRIPTOR_IMPL;
if (icon.getBitmap() != null) {
oldBitmap = new AndroidBitmap(icon.getBitmap());
prepareMarkerIcon(item);
} else {
if (!icon.loadBitmapAsync(context, new Runnable() {
@Override
public void run() {
listener.update(MarkerImpl.this);
}
})) {
// Was loaded since last check...
oldBitmap = new AndroidBitmap(icon.getBitmap());
prepareMarkerIcon(item);
}
// Keep old icon while loading new
if (oldBitmap != null) {
prepareMarkerIcon(item);
}
}
return item;
}
Aggregations