本文整理汇总了Java中gov.nasa.worldwind.geom.LatLon.fromDegrees方法的典型用法代码示例。如果您正苦于以下问题:Java LatLon.fromDegrees方法的具体用法?Java LatLon.fromDegrees怎么用?Java LatLon.fromDegrees使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nasa.worldwind.geom.LatLon
的用法示例。
在下文中一共展示了LatLon.fromDegrees方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseCoordinates
import gov.nasa.worldwind.geom.LatLon; //导入方法依赖的package包/类
private PointOfInterest parseCoordinates(String coords[])
{
if (isDecimalDegrees(coords))
{
Double d1 = Double.parseDouble(coords[0].trim());
Double d2 = Double.parseDouble(coords[1].trim());
return new BasicPointOfInterest(LatLon.fromDegrees(d1, d2));
}
else //may be in DMS
{
Angle aLat = Angle.fromDMS(coords[0].trim());
Angle aLon = Angle.fromDMS(coords[1].trim());
return new BasicPointOfInterest(LatLon.fromDegrees(aLat.getDegrees(), aLon.getDegrees()));
}
}
示例2: zoomToWESN
import gov.nasa.worldwind.geom.LatLon; //导入方法依赖的package包/类
public void zoomToWESN(double[] wesn) {
double delta_x = wesn[1] - wesn[0];
double delta_y = wesn[3] - wesn[2];
double earthRadius = wwd.getModel().getGlobe().getRadius();
double horizDistance = earthRadius * delta_x;
double vertDistance = earthRadius * delta_y;
// Form a triangle consisting of the longest distance on the ground and the ray from the eye to the center point
// The ray from the eye to the midpoint on the ground bisects the FOV
double distance = Math.max(horizDistance, vertDistance) / 64;
double altitude = distance / Math.tan(wwd.getView().getFieldOfView().radians / 2);
LatLon latlon = LatLon.fromDegrees(wesn[2] + delta_y / 2, wesn[0] + delta_x / 2);
Position pos = new Position(latlon, altitude);
final OrbitView view = (OrbitView) wwd.getView();
Position oldPos = view.getEyePosition();
view.setEyePosition(pos);
Position center = view.getCenterPosition();
Angle heading = view.getHeading();
Angle pitch = view.getPitch();
double zoom = view.getZoom();
view.setEyePosition(oldPos);
FlyToOrbitViewAnimator fto =
FlyToOrbitViewAnimator.createFlyToOrbitViewAnimator(
view,
view.getCenterPosition(), center,
view.getHeading(), heading,
view.getPitch(), pitch,
view.getZoom(), zoom,
5000, WorldWind.CONSTANT); //was true
view.addAnimator(fto);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
((MapApp)getApp()).getFrame().toFront();
view.firePropertyChange(AVKey.VIEW, null, view);
}
});
}
示例3: convert
import gov.nasa.worldwind.geom.LatLon; //导入方法依赖的package包/类
private LatLon convert(final PositionVector v) {
final double[] geodeticCoord = CoordinatesConverter.toGeodetic(v);
return LatLon.fromDegrees(geodeticCoord[0], geodeticCoord[1]);
}