use of org.microg.gms.maps.bitmap.BitmapDescriptorImpl 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