-
Notifications
You must be signed in to change notification settings - Fork 19
concepts navigation
These methos of class Map
are designed for incremental changes made by user.
You pass in directly the differences in mouse position since last frame.
These functions also work with inertia, making all the movements smooth and nice.
These setters and getters directly change the target position of the map.
The mode in which they are applied is determined by the NavigationType
argument.
- 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.
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 all be 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 center of orbit is computed directly from the fov and view extent.
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.
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.