Class vg.mapviewer.kiosk.Camera

MapViewer's camera class. Controls position, pitch of camera and map rotation.

  • Defined in: <src/com/visioglobe/kiosk/Camera.js>
Class Summary
Constructor Attributes Constructor Name and Description
 

Method Summary

Class Detail

vg.mapviewer.kiosk.Camera()

Field Detail

{number} maxPitch
Controls the maximum pitch of the camera. The value units is in degrees. Default value is -86
Since:
1.6
{number} maxRadius
Controls the radius of the camera's position. Default value is such that one can see the whole map.
Since:
1.6
{number} minPitch
Controls the minimum pitch of the camera. The value units is in degrees. Default value is -45
Since:
1.7.11 changed default value to -45, 1.6 initial version
{number} minRadius
Controls the minimum radius of the camera's position. Default value is 10
Since:
1.6
{boolean} panManipulatorEnabled
Enables/disables pan manipulation (drag)
Since:
1.7.11
{number} pitch
Controls the camera pitch. The value units is in degrees. -90 is looking down, 90 is looking up. Trying to set its value greater than its minimum or maximum will clamp its value.
{boolean} pitchManipulatorEnabled
Enables/disables right mouse button control of pitch.
{positionObject} position
The resulting position object contains x,y,radius attributes. Attributes .x, .y and .radius are in meters. The camera has a default Field of View of 45 degrees vertically. To position the map so it fits on the screen, place the camera at half the width of your map / tan(45.0 deg / 2.0 ). The initial value is such that one can see the whole map. setting its value is equivalent to a goTo() with 0ms animationDuration.
{number} rotation
Controls the rotation of the map. The value units is in degrees. Default value is 0. The map initial rotation depends on how the map was prepared.
{boolean} rotationManipulatorEnabled
Enables/disables right mouse button control of map rotation.
{boolean} zoomManipulatorEnabled
Enables/disables zoom control (radius of the position attribute) of map by mousewheel, drag with middle mouse button or two finger pinch. Default value is false.

Method Detail

  • {BoundaryObject} getBoundary()
    returns the current camera boundaries. The initial boundaries are such that the map footprint is the same as the one seen on the VisioMapEditor. This boundary uses local points and is axis aligned. NOTE: it is possible that if the map represents a small portion of the VisioMapEditor footprint the map could be moved off the screen.
    Since:
    1.7.11
    Returns:
    {BoundaryObject} object with {min: {x: .., y: ..}, max: {x: .., y:..} }
  • {jQuery.Deferred Promise} goTo(place, parameters)
    This method will animate the camera so that is can see the specified place (Object3D). If the previous animation has not been completed, it will be stopped. If the placeObject is on another floor, the camera will be animated to the postion of the placeObject without changing floors.
    Parameters:
    {vg.mapviewer.kiosk.Place|string|object} place
    the placeObject or place ID or positionObject (x,y,radius) to go to.
    {object} parameters
    a parameter map supporting the following values:
    {string} parameters.animationDuration Optional
    duration of animation in milliseconds. default 500ms. if animationDuration is 0, the change is not immediate, the function will return, and done() will be called as soon as possible. If you want immediate change use mapviewer.camera.position = locationObject.
    Returns:
    {jQuery.Deferred Promise} done() will be called once animation is completed, or fail() in case of error or a new goTo has been called.
  • setBoundary(Object)
    sets the current camera boundaries. The position on the center of the map container never be outside this boundary. The behaviour of camera boundaries between VisioKiosk and VisioWeb2D are different. If you want to have the previous version unbounded behaviour, you can set a very large boundary for example: mapviewer.camera.setBoundary({min: {x:-1e9,y:-1e9}, max: {x:1e9,y:1e9}})
    Parameters:
    {BoundaryObject} Object
    with {min: {x: .., y: ..}, max: {x: .., y:..} }
    Since:
    1.7.11