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);
}
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);
}
}
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);
}
}
Aggregations