public static Bitmap getElevationBitmap(final Resources res, final int markerHeight, final double altitude) {
        final float textSizeInPx = ViewUtils.dpToPixel(14f);
        final int width = (int) (8 * textSizeInPx);
        final int height = markerHeight + (int) (2 * textSizeInPx) + 2;

        if (elevationTextPaint == null) {
            elevationTextPaint = new TextPaint();
            elevationTextPaint.setColor(0xff007ae3); // same as in heading indicator
            elevationTextPaint.setTextSize(textSizeInPx);
            elevationTextPaint.setAntiAlias(true);
            elevationTextPaint.setTextAlign(Paint.Align.CENTER);
        }

        if (elevationPaint == null) {
            elevationPaint = new Paint();
            elevationPaint.setColor(res.getColor(R.color.osm_zoomcontrolbackground));
            elevationPaint.setStrokeCap(Paint.Cap.ROUND);
            elevationPaint.setStrokeWidth(textSizeInPx);
        }

        final Bitmap bm = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
        final android.graphics.Canvas canvas = new android.graphics.Canvas(bm);
        final String info = Units.formatElevation((float) altitude);

        final float textWidth = elevationTextPaint.measureText(info) + 10;
        final float yPos = height - 0.45f * textSizeInPx;
        canvas.drawLine((float) (width - textWidth) / 2, yPos, (float) (width + textWidth) / 2, yPos, elevationPaint);

        canvas.drawText(info, (int) (width / 2), height - 4, elevationTextPaint);

        return bm;
    }
@return the complete popup builder without dismiss listener specified
main/src/main/java/cgeo/geocaching/maps/MapUtils.java