- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中gov.nasa.worldwind.WorldWindow.getNavigator()
方法的一些代码示例,展示了WorldWindow.getNavigator()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorldWindow.getNavigator()
方法的具体详情如下:
包路径:gov.nasa.worldwind.WorldWindow
类名称:WorldWindow
方法名:getNavigator
暂无
代码示例来源:origin: NASAWorldWind/WorldWindAndroid
@Override
public void creationSucceeded(LayerFactory factory, Layer layer) {
// Add the finished GeoPackage layer to the WorldWindow.
getWorldWindow().getLayers().addLayer(layer);
// Place the viewer directly over the GeoPackage image.
getWorldWindow().getNavigator().setLatitude(36.8139677556754);
getWorldWindow().getNavigator().setLongitude(-76.03260320181615);
getWorldWindow().getNavigator().setAltitude(20e3);
Log.i("gov.nasa.worldwind", "GeoPackage layer creation succeeded");
}
代码示例来源:origin: NASAWorldWind/WorldWindAndroid
@Override
protected void gestureDidBegin() {
if (this.activeGestures++ == 0) {
this.wwd.getNavigator().getAsCamera(this.wwd.getGlobe(), this.beginCamera);
this.camera.set(this.beginCamera);
}
}
代码示例来源:origin: NASAWorldWind/WorldWindAndroid
protected void gestureDidBegin() {
if (this.activeGestures++ == 0) {
this.wwd.getNavigator().getAsLookAt(this.wwd.getGlobe(), this.beginLookAt);
this.lookAt.set(this.beginLookAt);
}
}
代码示例来源:origin: NASAWorldWind/WorldWindAndroid
protected void positionView(WorldWindow wwd) {
LookAt lookAt = new LookAt().set(46.230, -122.190, 500, WorldWind.ABSOLUTE, 1.5e4 /*range*/, 45.0 /*heading*/, 70.0 /*tilt*/, 0 /*roll*/);
wwd.getNavigator().setAsLookAt(this.getWorldWindow().getGlobe(), lookAt);
}
}
代码示例来源:origin: NASAWorldWind/WorldWindAndroid
@Override
public void run() {
this.wwd.getNavigator().setAsCamera(this.wwd.getGlobe(), this.camera);
this.wwd.requestRedraw();
pool.release(this.reset());
}
}
代码示例来源:origin: NASAWorldWind/WorldWindAndroid
protected void positionView(WorldWindow wwd) {
Position mtRainier = new Position(46.852886, -121.760374, 4392.0);
Position eye = new Position(46.912, -121.527, 2000.0);
// Compute heading and distance from peak to eye
Globe globe = wwd.getGlobe();
double heading = eye.greatCircleAzimuth(mtRainier);
double distanceRadians = mtRainier.greatCircleDistance(eye);
double distance = distanceRadians * globe.getRadiusAt(mtRainier.latitude, mtRainier.longitude);
// Compute camera settings
double altitude = eye.altitude - mtRainier.altitude;
double range = Math.sqrt(altitude * altitude + distance * distance);
double tilt = Math.toDegrees(Math.atan(distance / eye.altitude));
// Apply the new view
Camera camera = new Camera();
camera.set(eye.latitude, eye.longitude, eye.altitude, WorldWind.ABSOLUTE, heading, tilt, 0.0 /*roll*/);
wwd.getNavigator().setAsCamera(globe, camera);
}
}
代码示例来源:origin: NASAWorldWind/WorldWindAndroid
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setAboutBoxTitle("About the " + this.getResources().getText(R.string.title_placemarks_milstd2525));
setAboutBoxText("Demonstrates how to add MilStd2525C Symbols to a RenderableLayer.");
// Create a TextView to show the MIL-STD-2525 renderer's initialization status
this.statusText = new TextView(this);
this.statusText.setTextColor(android.graphics.Color.YELLOW);
FrameLayout globeLayout = (FrameLayout) findViewById(R.id.globe);
globeLayout.addView(this.statusText);
// Set the camera to look at the area where the symbols will be displayed.
Position pos = new Position(32.4520, 63.44553, 0);
LookAt lookAt = new LookAt().set(pos.latitude, pos.longitude, pos.altitude, WorldWind.ABSOLUTE,
1e5 /*range*/, 0 /*heading*/, 45 /*tilt*/, 0 /*roll*/);
this.getWorldWindow().getNavigator().setAsLookAt(this.getWorldWindow().getGlobe(), lookAt);
// The MIL-STD-2525 rendering library takes time initialize, we'll perform this task via the
// AsyncTask's background thread and then load the symbols in its post execute handler.
new InitializeSymbolsTask().execute();
}
代码示例来源:origin: NASAWorldWind/WorldWindAndroid
@Override
public void doFrame(long frameTimeNanos) {
if (this.lastFrameTimeNanos != 0) {
// Compute the frame duration in seconds.
double frameDurationSeconds = (frameTimeNanos - this.lastFrameTimeNanos) * 1.0e-9;
double cameraDegrees = (frameDurationSeconds * this.cameraDegreesPerSecond);
// Move the navigator to continuously bring new tiles into view.
Navigator navigator = getWorldWindow().getNavigator();
navigator.setLongitude(navigator.getLongitude() + cameraDegrees);
// Redraw the WorldWindow to display the above changes.
this.getWorldWindow().requestRedraw();
}
Choreographer.getInstance().postFrameCallback(this);
this.lastFrameTimeNanos = frameTimeNanos;
}
代码示例来源:origin: NASAWorldWind/WorldWindAndroid
@Override
public void doFrame(long frameTimeNanos) {
if (this.lastFrameTimeNanos != 0) {
// Compute the frame duration in seconds.
double frameDurationSeconds = (frameTimeNanos - this.lastFrameTimeNanos) * 1.0e-9;
double cameraDegrees = (frameDurationSeconds * this.cameraDegreesPerSecond);
// Move the navigator to simulate the Earth's rotation about its axis.
Navigator navigator = getWorldWindow().getNavigator();
navigator.setLongitude(navigator.getLongitude() - cameraDegrees);
// Redraw the WorldWindow to display the above changes.
this.getWorldWindow().requestRedraw();
}
if (!this.activityPaused) { // stop animating when this Activity is paused
Choreographer.getInstance().postFrameCallback(this);
}
this.lastFrameTimeNanos = frameTimeNanos;
}
代码示例来源:origin: NASAWorldWind/WorldWindAndroid
@Override
public void doFrame(long frameTimeNanos) {
if (this.lastFrameTimeNanos != 0) {
// Compute the frame duration in seconds.
double frameDurationSeconds = (frameTimeNanos - this.lastFrameTimeNanos) * 1.0e-9;
double cameraDegrees = (frameDurationSeconds * this.cameraDegreesPerSecond);
// Move the navigator to simulate the Earth's rotation about its axis.
Navigator navigator = getWorldWindow().getNavigator();
navigator.setLongitude(navigator.getLongitude() - cameraDegrees);
// Redraw the WorldWindow to display the above changes.
this.getWorldWindow().requestRedraw();
}
if (!this.activityPaused) { // stop animating when this Activity is paused
Choreographer.getInstance().postFrameCallback(this);
}
this.lastFrameTimeNanos = frameTimeNanos;
}
代码示例来源:origin: NASAWorldWind/WorldWindAndroid
/**
* Creates a new WorldWindow object with a custom WorldWindowController.
*/
@Override
public WorldWindow createWorldWindow() {
// Let the super class (BasicGlobeFragment) do the creation
WorldWindow wwd = super.createWorldWindow();
// Override the default "look at" gesture behavior with a camera centric gesture controller
wwd.setWorldWindowController(new CameraController());
// Create a camera position above KOXR airport, Oxnard, CA
Camera camera = new Camera();
camera.set(34.2, -119.2,
10000, WorldWind.ABSOLUTE,
90, // Looking east
70, // Lookup up from nadir
0); // No roll
// Apply the new camera position
Globe globe = wwd.getGlobe();
wwd.getNavigator().setAsCamera(globe, camera);
return wwd;
}
代码示例来源:origin: NASAWorldWind/WorldWindAndroid
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setAboutBoxTitle("About the " + this.getResources().getText(R.string.title_basic_stress_test));
this.setAboutBoxText("Continuously moves the navigator in an Easterly direction from a low altitude.");
// Add the ShowTessellation layer to provide some visual feedback regardless of texture details
this.getWorldWindow().getLayers().addLayer(new ShowTessellationLayer());
// Initialize the Navigator so that it's looking in the direction of movement and the horizon is visible.
Navigator navigator = this.getWorldWindow().getNavigator();
navigator.setAltitude(1e3); // 1 km
navigator.setHeading(90); // looking east
navigator.setTilt(75); // looking at the horizon
}
代码示例来源:origin: NASAWorldWind/WorldWindAndroid
protected void handlePinch(GestureRecognizer recognizer) {
int state = recognizer.getState();
float scale = ((PinchRecognizer) recognizer).getScale();
if (state == WorldWind.BEGAN) {
this.gestureDidBegin();
} else if (state == WorldWind.CHANGED) {
if (scale != 0) {
// Apply the change in scale to the navigator, relative to when the gesture began.
this.lookAt.range = this.beginLookAt.range / scale;
this.applyLimits(this.lookAt);
this.wwd.getNavigator().setAsLookAt(this.wwd.getGlobe(), this.lookAt);
this.wwd.requestRedraw();
}
} else if (state == WorldWind.ENDED || state == WorldWind.CANCELLED) {
this.gestureDidEnd();
}
}
代码示例来源:origin: NASAWorldWind/WorldWindAndroid
protected void handleRotate(GestureRecognizer recognizer) {
int state = recognizer.getState();
float rotation = ((RotationRecognizer) recognizer).getRotation();
if (state == WorldWind.BEGAN) {
this.gestureDidBegin();
this.lastRotation = 0;
} else if (state == WorldWind.CHANGED) {
// Apply the change in rotation to the navigator, relative to the navigator's current values.
double headingDegrees = this.lastRotation - rotation;
this.lookAt.heading = WWMath.normalizeAngle360(this.lookAt.heading + headingDegrees);
this.lastRotation = rotation;
this.wwd.getNavigator().setAsLookAt(this.wwd.getGlobe(), this.lookAt);
this.wwd.requestRedraw();
} else if (state == WorldWind.ENDED || state == WorldWind.CANCELLED) {
this.gestureDidEnd();
}
}
代码示例来源:origin: NASAWorldWind/WorldWindAndroid
@Override
protected void handleRotate(GestureRecognizer recognizer) {
int state = recognizer.getState();
float rotation = ((RotationRecognizer) recognizer).getRotation();
if (state == WorldWind.BEGAN) {
this.gestureDidBegin();
this.lastRotation = 0;
} else if (state == WorldWind.CHANGED) {
// Apply the change in rotation to the navigator, relative to the navigator's current values.
double headingDegrees = this.lastRotation - rotation;
this.camera.heading = WWMath.normalizeAngle360(this.camera.heading + headingDegrees);
this.lastRotation = rotation;
this.wwd.getNavigator().setAsCamera(this.wwd.getGlobe(), this.camera);
this.wwd.requestRedraw();
} else if (state == WorldWind.ENDED || state == WorldWind.CANCELLED) {
this.gestureDidEnd();
}
}
代码示例来源:origin: NASAWorldWind/WorldWindAndroid
@Override
protected void handlePinch(GestureRecognizer recognizer) {
int state = recognizer.getState();
float scale = ((PinchRecognizer) recognizer).getScale();
if (state == WorldWind.BEGAN) {
this.gestureDidBegin();
} else if (state == WorldWind.CHANGED) {
if (scale != 0) {
// Apply the change in scale to the navigator, relative to when the gesture began.
scale = ((scale - 1) * 0.1f) + 1; // dampen the scale factor
this.camera.altitude = this.camera.altitude * scale;
this.applyLimits(this.camera);
this.wwd.getNavigator().setAsCamera(this.wwd.getGlobe(), this.camera);
this.wwd.requestRedraw();
}
} else if (state == WorldWind.ENDED || state == WorldWind.CANCELLED) {
this.gestureDidEnd();
}
}
代码示例来源:origin: NASAWorldWind/WorldWindAndroid
@Override
public void run() {
this.wwd.getNavigator().getAsCamera(this.wwd.getGlobe(), this.beginCamera);
this.beginPos.set(this.beginCamera.latitude, this.beginCamera.longitude, this.beginCamera.altitude);
for (int i = 0; i < this.steps; i++) {
double amount = (double) i / (double) (this.steps - 1);
this.beginPos.interpolateAlongPath(this.endPos, WorldWind.GREAT_CIRCLE, amount, this.curPos);
this.curCamera.latitude = this.curPos.latitude;
this.curCamera.longitude = this.curPos.longitude;
this.curCamera.altitude = this.curPos.altitude;
this.curCamera.heading = WWMath.interpolateAngle360(amount, this.beginCamera.heading, this.endCamera.heading);
this.curCamera.tilt = WWMath.interpolateAngle180(amount, this.beginCamera.tilt, this.endCamera.tilt);
this.curCamera.roll = WWMath.interpolateAngle180(amount, this.beginCamera.roll, this.endCamera.roll);
Runnable setCommand = SetCameraCommand.obtain(this.wwd, this.curCamera);
runOnActivityThread(setCommand);
sleepQuietly(FRAME_INTERVAL);
}
}
}
代码示例来源:origin: NASAWorldWind/WorldWindAndroid
@Override
public void doFrame(long frameTimeNanos) {
if (this.lastFrameTimeNanos != 0) {
// Compute the frame duration in seconds.
double frameDurationSeconds = (frameTimeNanos - this.lastFrameTimeNanos) * 1.0e-9;
double cameraDegrees = (frameDurationSeconds * this.cameraDegreesPerSecond);
double lightDegrees = (frameDurationSeconds * this.lightDegreesPerSecond);
// Move the navigator to simulate the Earth's rotation about its axis.
Navigator navigator = getWorldWindow().getNavigator();
navigator.setLongitude(navigator.getLongitude() - cameraDegrees);
// Move the sun location to simulate the Sun's rotation about the Earth.
this.sunLocation.set(this.sunLocation.latitude, this.sunLocation.longitude - lightDegrees);
this.atmosphereLayer.setLightLocation(this.sunLocation);
// Redraw the WorldWindow to display the above changes.
this.getWorldWindow().requestRedraw();
}
if (!this.activityPaused) { // stop animating when this Activity is paused
Choreographer.getInstance().postFrameCallback(this);
}
this.lastFrameTimeNanos = frameTimeNanos;
}
代码示例来源:origin: NASAWorldWind/WorldWindAndroid
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setAboutBoxTitle("About the " + this.getResources().getText(R.string.title_day_night_cycle));
setAboutBoxText("Demonstrates how to display a continuous day-night cycle on the WorldWind globe.\n" +
"This gradually changes both the Navigator's location and the AtmosphereLayer's light location.");
// Initialize the Atmosphere layer's light location to our custom location. By default the light location is
// always behind the viewer.
LayerList layers = this.getWorldWindow().getLayers();
this.atmosphereLayer = (AtmosphereLayer) layers.getLayer(layers.indexOfLayerNamed("Atmosphere"));
this.atmosphereLayer.setLightLocation(this.sunLocation);
// Initialize the Navigator so that the sun is behind the viewer.
Navigator navigator = this.getWorldWindow().getNavigator();
navigator.setLatitude(20);
navigator.setLongitude(this.sunLocation.longitude);
// Use this Activity's Choreographer to animate the day-night cycle.
Choreographer.getInstance().postFrameCallback(this);
}
代码示例来源:origin: NASAWorldWind/WorldWindAndroid
protected void handleTilt(GestureRecognizer recognizer) {
int state = recognizer.getState();
float dx = recognizer.getTranslationX();
float dy = recognizer.getTranslationY();
if (state == WorldWind.BEGAN) {
this.gestureDidBegin();
this.lastRotation = 0;
} else if (state == WorldWind.CHANGED) {
// Apply the change in tilt to the navigator, relative to when the gesture began.
double headingDegrees = 180 * dx / this.wwd.getWidth();
double tiltDegrees = -180 * dy / this.wwd.getHeight();
this.lookAt.heading = WWMath.normalizeAngle360(this.beginLookAt.heading + headingDegrees);
this.lookAt.tilt = this.beginLookAt.tilt + tiltDegrees;
this.applyLimits(this.lookAt);
this.wwd.getNavigator().setAsLookAt(this.wwd.getGlobe(), this.lookAt);
this.wwd.requestRedraw();
} else if (state == WorldWind.ENDED || state == WorldWind.CANCELLED) {
this.gestureDidEnd();
}
}
我在 WorldWindowGLJPanel 的图层列表中添加了两个图层。其中一个是包含形状的 RenderableLayer,另一个是包含光栅图像的 BasicTiledImageLayer。 (一
有没有办法将图像放入 WorldWind 中的海拔高度?我可以使用Surface Image将图像放置在地球上 - 但我希望将其放置在地形上方的给定高度处,但我在 API 中没有找到它。 最佳答案 您
我在 WorldWind 的 Sphere 中看到了看似矛盾的行为-线相交逻辑。我创建了一个 Sphere 和 Line,它们相交但随后交集返回 null(扫描代码以获取评论://*** 这就是它变得
在 NASA WorldWind Java 中,我使用 PointPlacemark 来表示图像,因为无论缩放级别如何,它都保持相同的大小。问题是我想在 Point Placemark 上设置航向,即
我正在经历这个tutorial 每当我的鼠标悬停在用这个 code 创建的立方体上时(下面是我的版本),大气层和星星消失了。 正常情况下是这样的: 这是我将鼠标悬停在立方体上时的样子(看看大气层):
我想将 WorldWindowGLJPanel 放入 Pane 中,并且希望使其可调整大小,但我不能,即使我调用 resize 或 setSize 方法。 这是我正在做的事情: wwd = new W
我想创建一个应用程序,允许用户输入经度和纬度,然后将其显示在 map 上。我遇到过WorldWind但我以前从未听说过。 要创建这样的应用程序,我最好使用 WorldWind 或 OpenStreet
我想在地球上画一 strip 有高程表示的线,如下所示: 我知道我可以用折线来表示一条线,但是如何填充线下方的空间? 最佳答案 您可以使用路径来画线。 setOutlineMaterial 将绘制一个
我正在尝试在 NASA Worldwind for Java 中实现我自己的杂波过滤器,它导致了一个奇怪的问题 - 杂波过滤器还没有做太多事情,但当我通过时,我将使用它来移动东西。 “闪烁”问题。每当
当我点击地球时,我在获取位置(纬度/经度)时遇到了问题。 SO(和其他网站)上的任何地方都建议使用 getCurrentPosition 方法。 不幸的是,这会返回包含单击点的顶部可拾取对象的位置,因
Worldwind 的 Point PlaceMark 可渲染具有通过调用 setLineEnabled 从地标向下到地形放置一条线的功能。如此屏幕截图所示: 我想要做的是添加这样的一行,它也适用于可
我正在尝试找出一种方法,以编程方式获取用户在 WorldWind AnalyticSurface 上单击的点的视觉颜色(而不是拾取颜色)。 查看AnalyticSurface和 PickedObjec
我知道在 WorldWind Java 中,您可以通过以下方式找到海拔高度和特定位置: public Double getPositionElevationMeters(Double lat, Dou
本文整理了Java中gov.nasa.worldwind.util.WWMath类的一些代码示例,展示了WWMath类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Mav
我正在从事与 nasa worldwind 相关的项目。 任何人都可以向我解释一下,我可以删除世界地图吗? 位于屏幕左上方。 最佳答案 如果您使用的是自定义 layers.xml 文件,您可以注释掉以
所以,我意识到这可能不是正确的网站,但我认为在 WorldWind 论坛上提问是不礼貌的。如果应该在其他地方,请告诉我。 无论如何... 我有一个 Java 应用程序,当前使用 WorldWind 来
我是 Web WorldWind 的新手,如果这是一个简单的问题,请原谅我,但我还没有在文档或其他地方找到解决方案。我有以下内容: Your browser does n
大家好!我在 WorldWind 库(它是 NASA 库)方面遇到了一些问题。我在 JetBrains Idea 14 中使用 Java 8 编写应用程序。在 Idea 中,我可以成功编译并运行我的应
我正在使用 WorldWind 并尝试在同一层中“挑选”多个表面图像,但不明白为什么它不起作用。 我的印象是这样称呼: this.getWwd().getSceneController().setDe
我有一个 WorldWindow,上面有各种 RenderableLayer。我想在运行时添加一个 CompassLayer。 try { String compassPath = "imag
我是一名优秀的程序员,十分优秀!