Search in sources :

Example 1 with FavoriteImageDrawable

use of net.osmand.plus.base.FavoriteImageDrawable in project Osmand by osmandapp.

the class GPXLayer method drawBigPoint.

private void drawBigPoint(Canvas canvas, WptPt o, int fileColor, float x, float y, boolean synced) {
    int pointColor = getPointColor(o, fileColor);
    FavoriteImageDrawable fid;
    if (synced) {
        fid = FavoriteImageDrawable.getOrCreateSyncedIcon(view.getContext(), pointColor);
    } else {
        fid = FavoriteImageDrawable.getOrCreate(view.getContext(), pointColor, true);
    }
    fid.drawBitmapInCenter(canvas, x, y);
}
Also used : FavoriteImageDrawable(net.osmand.plus.base.FavoriteImageDrawable) Paint(android.graphics.Paint)

Example 2 with FavoriteImageDrawable

use of net.osmand.plus.base.FavoriteImageDrawable in project Osmand by osmandapp.

the class FavouritesLayer method drawPoint.

private void drawPoint(Canvas canvas, RotatedTileBox tileBox, final QuadRect latLonBounds, FavouritePoint o, boolean synced) {
    if (o.isVisible() && o.getLatitude() >= latLonBounds.bottom && o.getLatitude() <= latLonBounds.top && o.getLongitude() >= latLonBounds.left && o.getLongitude() <= latLonBounds.right) {
        cache.add(o);
        int x = (int) tileBox.getPixXFromLatLon(o.getLatitude(), o.getLongitude());
        int y = (int) tileBox.getPixYFromLatLon(o.getLatitude(), o.getLongitude());
        FavoriteImageDrawable fid;
        if (synced) {
            fid = FavoriteImageDrawable.getOrCreateSyncedIcon(view.getContext(), o.getColor());
        } else {
            fid = FavoriteImageDrawable.getOrCreate(view.getContext(), o.getColor(), true);
        }
        fid.drawBitmapInCenter(canvas, x, y);
    }
}
Also used : FavoriteImageDrawable(net.osmand.plus.base.FavoriteImageDrawable) FavouritePoint(net.osmand.data.FavouritePoint) Paint(android.graphics.Paint)

Example 3 with FavoriteImageDrawable

use of net.osmand.plus.base.FavoriteImageDrawable in project Osmand by osmandapp.

the class FavouritesLayer method onDraw.

@Override
public void onDraw(Canvas canvas, RotatedTileBox tileBox, DrawSettings settings) {
    if (contextMenuLayer.getMoveableObject() instanceof FavouritePoint) {
        FavouritePoint objectInMotion = (FavouritePoint) contextMenuLayer.getMoveableObject();
        FavoriteImageDrawable fid;
        if (mapMarkersHelper.isSynced(objectInMotion)) {
            fid = FavoriteImageDrawable.getOrCreateSyncedIcon(view.getContext(), objectInMotion.getColor());
        } else {
            fid = FavoriteImageDrawable.getOrCreate(view.getContext(), objectInMotion.getColor(), true);
        }
        PointF pf = contextMenuLayer.getMovableCenterPoint(tileBox);
        fid.drawBitmapInCenter(canvas, pf.x, pf.y);
    }
}
Also used : FavouritePoint(net.osmand.data.FavouritePoint) PointF(android.graphics.PointF) FavoriteImageDrawable(net.osmand.plus.base.FavoriteImageDrawable)

Aggregations

FavoriteImageDrawable (net.osmand.plus.base.FavoriteImageDrawable)3 Paint (android.graphics.Paint)2 FavouritePoint (net.osmand.data.FavouritePoint)2 PointF (android.graphics.PointF)1