Search in sources :

Example 1 with PolylineOverview

use of uk.me.parabola.imgfmt.app.trergn.PolylineOverview in project mkgmap by openstreetmap.

the class MakeTestLangMap method drawStreetnames.

private void drawStreetnames(Map map, Subdivision div, double slat, double slon) {
    char[] hexChars = "0123456789ABCDEF".toCharArray();
    double lat = slat + 0.004;
    double lon = slon + 0.002;
    div.startLines();
    map.setLabelCharset("simple8", true);
    double space = 0.002;
    double size = 0.006;
    for (int y = 0; y < 16; y++) {
        int start = 128 + 8 * y;
        char[] out = new char[19];
        out[0] = hexChars[(start & 0xf0) >> 4];
        out[1] = hexChars[(start & 0x0f)];
        out[2] = ' ';
        for (int i = 0; i < 8; i++) {
            out[3 + 2 * i] = (char) ('A' + i);
            out[3 + 2 * i + 1] = (char) (start + i);
        }
        String name = new String(out);
        Polyline l = div.createLine(new String[] { name, null, null, null });
        double baseLat = lat + y * space;
        Coord co = new Coord(baseLat, lon);
        l.addCoord(co);
        co = new Coord(baseLat, lon + size);
        l.addCoord(co);
        l.setType(6);
        map.addMapObject(l);
    }
    map.addPolylineOverview(new PolylineOverview(0x600, 10));
}
Also used : Coord(uk.me.parabola.imgfmt.app.Coord) PolylineOverview(uk.me.parabola.imgfmt.app.trergn.PolylineOverview) Polyline(uk.me.parabola.imgfmt.app.trergn.Polyline)

Example 2 with PolylineOverview

use of uk.me.parabola.imgfmt.app.trergn.PolylineOverview in project mkgmap by openstreetmap.

the class MapDetails method getOverviews.

/**
 * Get the overviews.  We construct them at this point from the information
 * that we have built up.
 * Perhaps this could be a separate class rather than a list.
 *
 * @return A list of overviews.
 */
public List<Overview> getOverviews() {
    List<Overview> ovlist = new ArrayList<Overview>();
    for (Map.Entry<Integer, Integer> ent : pointOverviews.entrySet()) {
        Overview ov = new PointOverview(ent.getKey(), ent.getValue());
        ovlist.add(ov);
    }
    for (Map.Entry<Integer, Integer> ent : lineOverviews.entrySet()) {
        Overview ov = new PolylineOverview(ent.getKey(), ent.getValue());
        ovlist.add(ov);
    }
    for (Map.Entry<Integer, Integer> ent : shapeOverviews.entrySet()) {
        Overview ov = new PolygonOverview(ent.getKey(), ent.getValue());
        ovlist.add(ov);
    }
    return ovlist;
}
Also used : PolylineOverview(uk.me.parabola.imgfmt.app.trergn.PolylineOverview) PointOverview(uk.me.parabola.imgfmt.app.trergn.PointOverview) PolygonOverview(uk.me.parabola.imgfmt.app.trergn.PolygonOverview) ArrayList(java.util.ArrayList) Overview(uk.me.parabola.imgfmt.app.trergn.Overview) PolylineOverview(uk.me.parabola.imgfmt.app.trergn.PolylineOverview) PolygonOverview(uk.me.parabola.imgfmt.app.trergn.PolygonOverview) PointOverview(uk.me.parabola.imgfmt.app.trergn.PointOverview) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

PolylineOverview (uk.me.parabola.imgfmt.app.trergn.PolylineOverview)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Coord (uk.me.parabola.imgfmt.app.Coord)1 Overview (uk.me.parabola.imgfmt.app.trergn.Overview)1 PointOverview (uk.me.parabola.imgfmt.app.trergn.PointOverview)1 PolygonOverview (uk.me.parabola.imgfmt.app.trergn.PolygonOverview)1 Polyline (uk.me.parabola.imgfmt.app.trergn.Polyline)1