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);
}
}
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);
}
Aggregations