Search in sources :

Example 1 with AdminGeo

use of org.activityinfo.server.geo.AdminGeo in project activityinfo by bedatadriven.

the class ImageMapRenderer method drawAdminOverlay.

@Timed(name = "mapping.draw_admin_overlay")
protected void drawAdminOverlay(TiledMap map, Graphics2D g2d, AdminOverlay overlay) {
    List<AdminGeo> geometry = geometryProvider.getGeometries(overlay.getAdminLevelId());
    Color strokeColor = ColorUtil.colorFromString(overlay.getOutlineColor());
    g2d.setStroke(new BasicStroke(1, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
    for (AdminGeo adminGeo : geometry) {
        AdminMarker polygon = overlay.getPolygon(adminGeo.getId());
        if (polygon != null) {
            GeneralPath path = PathUtils.toPath(map, adminGeo.getGeometry());
            g2d.setColor(bubbleFillColor(ColorUtil.colorFromString(polygon.getColor())));
            g2d.fill(path);
            g2d.setColor(strokeColor);
            g2d.draw(path);
        }
    }
}
Also used : AdminGeo(org.activityinfo.server.geo.AdminGeo) GeneralPath(com.google.code.appengine.awt.geom.GeneralPath) Timed(org.activityinfo.server.util.monitoring.Timed)

Aggregations

GeneralPath (com.google.code.appengine.awt.geom.GeneralPath)1 AdminGeo (org.activityinfo.server.geo.AdminGeo)1 Timed (org.activityinfo.server.util.monitoring.Timed)1