Search in sources :

Example 1 with BitmapDescriptorImpl

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;
}
Also used : MarkerItem(org.oscim.layers.marker.MarkerItem) AndroidBitmap(org.oscim.android.canvas.AndroidBitmap) BitmapDescriptorImpl(org.microg.gms.maps.bitmap.BitmapDescriptorImpl)

Aggregations

BitmapDescriptorImpl (org.microg.gms.maps.bitmap.BitmapDescriptorImpl)1 AndroidBitmap (org.oscim.android.canvas.AndroidBitmap)1 MarkerItem (org.oscim.layers.marker.MarkerItem)1