VisioWeb2D 1.8.0

Class

vg.mapviewer.web2d.Camera

Mapviewer's camera class.

Constructor

new Camera()

Controls position, pitch of camera and map rotation.

Members

heading :number

Exists for compatibility reasons, always vg.mapviewer.web2d.cameraNorthRotation
Since:
  • 1.7.16

maxPitch :number

Exists for compabitibility reasons, always -90

maxRadius :number

Controls the maximum radius of the camera's position. Default value is map dependent, larger values up to an extent allows you to zoom out more. IE8 NOTE: You cannot read or change this value.

minPitch :number

Exists for compabitibility reasons, always -90

minRadius :number

Controls the minimum radius of the camera's position. Smaller values allows you to zoom in more. IE8 NOTE: You cannot read or change this value.

panManipulatorEnabled :boolean

Enables/disables pan manipulation (drag).

pitch :number

Exists for compabitibility reasons, always -90

pitchManipulatorEnabled :boolean

Exists for compatibility reasons, does nothing on tiled maps.

position :positionObject

The resulting position object contains x,y,radius attributes. Attributes .x/.y are local coordinates. Optional attribute .radius is in meters. 128 pixels of the map view will correspond measure camera.radius meters. The initial value is such that one can see the whole map on the current map view (by using the map's radius and normalizing it by the map window size). setting its value is equivalent to a goTo() with 0ms animationDuration. IE8 NOTE: On IE8 you can not read or set this value, use .goTo() to change camera position. There is no way to retrieve the current camera position on IE8.
Since:
  • 1.7.21 will work without .radius attribute (keep current radius)

rotation :number

Exists for compatibility reasons, always 0

rotationManipulatorEnabled :boolean

Exists for compatibility reasons, does nothing on tiled maps.

zoomManipulatorEnabled :boolean

enables/disable zooming via wheel, mouse, double click, and touch.

Methods

getBoundary() → {BoundaryObject}

returns the current map boundaries. The initial boundary is { min: {x:0,y:0}, max: {x:1,y:1}}, such that the map footprint is the same as the one seen on the VisioMapEditor This boundary uses local points and is axis aligned like the VisioMapEditor. 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:
object with {min: {x: .., y: ..}, max: {x: .., y:..} }
Type
BoundaryObject

goTo(place, parameters) → {jQuery.Deferred.Promise}

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:
Name Type Description
place vg.mapviewer.web2d.Place | string | object the placeObject or place ID or positionObject {.x,.y,.radius (optional)} to go to.
parameters object a parameter map supporting the following values:
Properties
Name Type Attributes Default Description
animationDuration string <optional>
250 duration of animation in milliseconds. if 0, the position change is immediate, but the function will return, and .done() will be called as soon as possible.
Since:
  • 1.7.21 will work without .radius attribute (keep current radius)
Returns:
done() will be called once animation is completed, or fail() in case of error or a new goTo has been called.
Type
jQuery.Deferred.Promise

setBoundary(Object)

sets the current map boundaries. The view will always make sure that nothing outside this boundary is visible. The behaviour of camera boundaries between VisioWeb 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:-10,y:-10}, max: {x:9,y:9}})
Parameters:
Name Type Description
Object BoundaryObject with {min: {x: .., y: ..}, max: {x: .., y:..} }
Since:
  • 1.7.11