iSelectionRectStart = pStart;
iSelectionRectEnd = pEnd;
Coordinate l1 = getPosition(p_max); // lon may be outside [-180,180]
Coordinate l2 = getPosition(p_min); // lon may be outside [-180,180]
Bounds b = new Bounds(
new LatLon(
Math.min(l2.getLat(), l1.getLat()),
LatLon.toIntervalLon(Math.min(l1.getLon(), l2.getLon()))
),
new LatLon(
Math.max(l2.getLat(), l1.getLat()),
LatLon.toIntervalLon(Math.max(l1.getLon(), l2.getLon())))
);
Bounds oldValue = this.bbox;
this.bbox = b;
repaint();
firePropertyChange(BBOX_PROP, oldValue, this.bbox);
}