Search in sources :

Example 1 with GeoPosition

use of org.jxmapviewer.viewer.GeoPosition in project bboxdb by jnidzwetzki.

the class OSMOverlayPainter method drawBoundingBox.

/**
 * Draw a bounding box on the screen
 */
protected void drawBoundingBox(final Graphics2D graphicsContext, final JXMapViewer map, final DistributionRegion distributionRegion) {
    final BoundingBox bbox = distributionRegion.getConveringBox();
    final BoundingBox paintBox = bbox.getIntersection(coverBox);
    final GeoPosition bl = new GeoPosition(paintBox.getCoordinateLow(0), paintBox.getCoordinateLow(1));
    final GeoPosition br = new GeoPosition(paintBox.getCoordinateLow(0), paintBox.getCoordinateHigh(1));
    final GeoPosition ul = new GeoPosition(paintBox.getCoordinateHigh(0), paintBox.getCoordinateLow(1));
    final GeoPosition ur = new GeoPosition(paintBox.getCoordinateHigh(0), paintBox.getCoordinateHigh(1));
    drawLine(graphicsContext, bl, br, map);
    drawLine(graphicsContext, br, ur, map);
    drawLine(graphicsContext, ur, ul, map);
    drawLine(graphicsContext, ul, bl, map);
    for (final DistributionRegion region : distributionRegion.getDirectChildren()) {
        drawBoundingBox(graphicsContext, map, region);
    }
}
Also used : DistributionRegion(org.bboxdb.distribution.region.DistributionRegion) BoundingBox(org.bboxdb.commons.math.BoundingBox) GeoPosition(org.jxmapviewer.viewer.GeoPosition)

Example 2 with GeoPosition

use of org.jxmapviewer.viewer.GeoPosition in project bboxdb by jnidzwetzki.

the class OSMView method showHagen.

/**
 * Show the university of Hagen in the viewer
 * @param mapViewer
 */
protected void showHagen() {
    final GeoPosition hagen = new GeoPosition(51.376255, 7.493675);
    mapViewer.setZoom(7);
    mapViewer.setAddressLocation(hagen);
}
Also used : GeoPosition(org.jxmapviewer.viewer.GeoPosition)

Aggregations

GeoPosition (org.jxmapviewer.viewer.GeoPosition)2 BoundingBox (org.bboxdb.commons.math.BoundingBox)1 DistributionRegion (org.bboxdb.distribution.region.DistributionRegion)1