/** * Moves the shape over the globe's surface. For a Placemark, this simply calls {@link * Placemark#setPosition(Position)}. * * @param globe not used. * @param position the new position of the shape's reference position. */ @Override public void moveTo(Globe globe, Position position) { setPosition(position); }
/** * Updates the aircraft placemark positions on the UI Thread. */ @Override protected void onPostExecute(Void notUsed) { super.onPostExecute(notUsed); // Update the aircraft placemark positions with the positions computed on the background thread. for (Placemark aircraft : aircraftPositions.keySet()) { aircraft.setPosition(aircraftPositions.get(aircraft)); } getWorldWindow().requestRedraw(); // Determine if the animation is done if (frameCount > ANIMATION_FRAMES) { // All the aircraft have arrived at their destinations; pause the animation pauseAnimation = true; statusText.setText("Animation complete"); } // Re-execute the animation after the prescribed delay if (!pauseAnimation) { handler.postDelayed(PlacemarksMilStd2525DemoActivity.this, DELAY_TIME); } } }
/** * Constructs a Placemark with a label that draws its representation at the supplied position using the given {@link * PlacemarkAttributes} bundle. The displayName is set to the supplied name string. * * @param position The placemark's geographic position * @param attributes The attributes to associate with this placemark. May be null, but if null the placemark will * not be drawn. * @param name The text for the {@link Placemark#displayName}. */ public Placemark(Position position, PlacemarkAttributes attributes, String name) { this.setPosition(position); this.setAltitudeMode(WorldWind.ABSOLUTE); this.setDisplayName(name == null || name.isEmpty() ? "Placemark" : name); // this.setLabel(name); // TODO: call setLabel(name) this.attributes = attributes; this.eyeDistanceScaling = false; this.eyeDistanceScalingThreshold = DEFAULT_EYE_DISTANCE_SCALING_THRESHOLD; this.eyeDistanceScalingLabelThreshold = 1.5 * this.eyeDistanceScalingThreshold; this.imageRotationReference = WorldWind.RELATIVE_TO_SCREEN; this.imageTiltReference = WorldWind.RELATIVE_TO_SCREEN; }