public synchronized Position goTo ( Double lon , Double lat , Double elev , Double azimuth , boolean animate ) { View view = getWwd ( ) . getView ( ) ; view . stopAnimations ( ) ; view . stopMovement ( ) ; Position eyePosition ; if ( lon == null || lat == null ) { Position currentEyePosition = wwd . getView ( ) . getCurrentEyePosition ( ) ; if ( currentEyePosition != null ) { lat = currentEyePosition . latitude . degrees ; lon = currentEyePosition . longitude . degrees ; } else { return null ; } } if ( elev == null ) { // use the current elev = wwd . getView ( ) . getCurrentEyePosition ( ) . getAltitude ( ) ; } if ( Double . isNaN ( elev ) ) { if ( ! Double . isNaN ( lastElevation ) ) { elev = lastElevation ; } else { elev = NwwUtilities . DEFAULT_ELEV ; } } eyePosition = NwwUtilities . toPosition ( lat , lon , elev ) ; if ( animate ) { view . goTo ( eyePosition , elev ) ; } else { view . setEyePosition ( eyePosition ) ; } if ( azimuth != null ) { Angle heading = Angle . fromDegrees ( azimuth ) ; view . setHeading ( heading ) ; } lastElevation = elev ; return eyePosition ; }
Move to a given location .