/** * Apply a rotation to the corner points of the overlay. * * @param dc Current draw context. */ protected void applyRotation(DrawContext dc) { KMLLatLonBox box = this.parent.getLatLonBox(); if (box != null) { Double rotation = box.getRotation(); if (rotation != null) { List <LatLon> corners = KMLUtil.rotateSector(dc.getGlobe(), this.getSector(), Angle.fromDegrees(rotation)); this.setCorners(corners); } } }
/** * Apply a rotation to the corner points of the overlay. This method is called the first time the polygon is * rendered, if the position is specified using a rotated LatLon box. * * @param dc Current draw context. */ protected void applyRotation(DrawContext dc) { // Rotation applies only to ground overlay position with a LatLon box. if (!(this.parent is KMLGroundOverlay)) { return; } KMLLatLonBox box = ((KMLGroundOverlay)this.parent).getLatLonBox(); if (box != null) { Double rotation = box.getRotation(); if (rotation != null) { Sector sector = KMLUtil.createSectorFromLatLonBox(box); java.util.List <LatLon> corners = KMLUtil.rotateSector(dc.getGlobe(), sector, Angle.fromDegrees(rotation)); this.setOuterBoundary(corners); } } }