void drawRuler(final int width, final int posX, final int posY) {

        int x = posX;
        Color even = new Color(0x333333);
        Color odd = new Color(0xCCCCCC);


        for (int i = 0; i <= width; i += 10) {
            if (i % 20 == 0) {
                g.setColor(odd);
            } else {
                g.setColor(even);
            }
            g.fillRect(x, posY, 10, 2);
            x += 10;
        }

        drawString(String.format("%2.0f km", 1 / scale * width / 1000.0), posX, posY + (int) miniFont.size, miniFont);

    }