Ejemplo n.º 1
0
    protected void initializeSphere(
        WorldWindow wwd, SphereAirspace sphere, boolean fitShapeToViewport) {
      // Creates a sphere in the center of the viewport. Attempts to guess at a reasonable size and
      // height.
      Position position = ShapeUtils.getNewShapePosition(wwd);
      double sizeInMeters =
          fitShapeToViewport ? ShapeUtils.getViewportScaleFactor(wwd) : DEFAULT_SHAPE_SIZE_METERS;

      sphere.setLocation(new LatLon(position));
      sphere.setRadius(sizeInMeters / 2.0);
    }