Ignore:
Timestamp:
2020-03-22T12:03:02+01:00 (5 years ago)
Author:
malcolmh
Message:

use XML DOM to parse OSM files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/seachart/src/render/Renderer.java

    r35391 r35392  
    2525
    2626import s57.S57map;
     27import s57.S57map.Feature;
    2728import s57.S57map.GeomIterator;
    2829import s57.S57map.Pflag;
     
    331332        if (context.grid() > 0) {
    332333            LineStyle style = new LineStyle(Color.black, (float)2.0);
    333             double nspan = 60 * Math.toDegrees(map.bounds.maxlon - map.bounds.minlon) / 5.0;
     334            double nspan = 60 * Math.toDegrees(map.bounds.maxlon - map.bounds.minlon) / context.grid();
    334335            double mult = 1.0;
    335336            if (nspan < 1.0) {
     
    373374            g2.setPaint(style.line);
    374375            g2.draw(p);
    375             double tspan = 60 * Math.toDegrees(map.bounds.maxlat - map.bounds.minlat) / 5.0;
     376            double tspan = 60 * Math.toDegrees(map.bounds.maxlat - map.bounds.minlat) / context.grid();
    376377            mult = 1.0;
    377378            if (tspan < 1.0) {
     
    413414            g2.setPaint(style.line);
    414415            g2.draw(p);
    415         }
     416/*            Symbol legend = new Symbol();
     417            legend.add(new Instr(Form.BBOX, new Rectangle2D.Double(0, 0, 900, 300)));
     418            Path2D.Double path = new Path2D.Double(); path.moveTo(0, 0); path.lineTo(900, 0); path.lineTo(900, 300); path.lineTo(0, 300); path.closePath();
     419            legend.add(new Instr(Form.FILL, Color.white));
     420            legend.add(new Instr(Form.PGON, path));
     421            legend.add(new Instr(Form.TEXT, new Caption("© OpenStreetMap contributors", new Font("Arial", Font.PLAIN, 25), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(450, 300)))));
     422            legend.add(new Instr(Form.TEXT, new Caption("Mercator projection", new Font("Arial", Font.PLAIN, 30), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(450, 250)))));
     423            Point2D point = context.getPoint(new Snode(map.bounds.minlat, map.bounds.minlon));
     424            Symbols.drawSymbol(g2, legend, sScale, point.getX(), point.getY(), null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(0, 0)));
     425            legend = new Symbol();
     426            legend.add(new Instr(Form.BBOX, new Rectangle2D.Double(0, 0, 900, 300)));
     427            legend.add(new Instr(Form.TEXT, new Caption("Mercator projection", new Font("Arial", Font.PLAIN, 30), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(450, 250)))));
     428            point = context.getPoint(new Snode(map.bounds.minlat, map.bounds.minlon));
     429            Symbols.drawSymbol(g2, legend, sScale, point.getX(), point.getY(), null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(0, 0)));
     430*/        }
    416431    }
    417432
Note: See TracChangeset for help on using the changeset viewer.