Skip to content

concepts navigation

Tomáš Malý edited this page Nov 29, 2017 · 6 revisions

Navigation

Pan, Rotate and Zoom

These methods of class Map are designed for incremental changes made by user. You pass in directly the differences in mouse position since last frame, measured in pixels.

Position Point, Rotation, View Extent and Fov

These setters/getters directly change/retrieve the target position of the map.

The point is the actual position given in navigation coordinates. The rotation is pitch, yaw and roll in degrees. The view extent is physical length that should be entirely visible in the camera, at the distance of the center of orbit. And the fov (field of view) is angle in degrees, at which the camera sees the view extent.

The distance between camera center and orbit pivot is computed directly from the fov and view extent.

Navigation Types

Navigation type determines how changes to position (and rotation) are applied. There are several options:

  • Instant - will immediately apply the change, without any inertia or delay.
  • Quick - is for regular navigation, the camera moves the faster the further it is from the desired value.
  • FlyOver - is designed for flies over long distances with perceptually invariant speed of changes on the screen.

Other Methods

Method Map::resetPositionAltitude will move the current position vertically to sit directly on the terrain.

Method Map::resetPositionRotation will realign the camera to look straight down onto the map with top pointing towards north.

Methods Map::setPositionJson and Map::getPositionJson set or retrieve current position as a single json-encoded string. This is the format that is used in the map config itself.

Methods Map::setPositionUrl and Map::getPositionUrl set or retrieve current position as a single url-encoded string. This is the format that the VTS Browser JS shows in the URL parameter.

Navigation Modes

These two are the basic navigation modes.

  • Azimuthal - the camera is always aligned north-up and is forbidden to move too close to the poles.
  • Free - yaw rotation is unlimited and the camera may move freely over poles.

However, as the azimuthal mode implies limitations that are unnecessary in close zoom levels, and as the free mode allows people to lose context, the best option is to somehow switch between these two.

  • Dynamic - the navigation starts as if in azimuthal mode and switches to free mode when the camera gets too close to a pole, or when the camera orientation is changed.
  • Seamless - allows to switch between the two basic modes back and forth based on the zoom level with a smooth transition.
Clone this wiki locally