VisioWeb 1.9.5

Class

visioweb.MultiBuildingView

For multi-building maps only, this class manages the state changes when exploring buildings.
Requirements:
  • Dataset should be published with sdk.web>=1.7.14

Storyboard:
  • There are three potential modes: global, building, floor
  • global mode shows the outside view of the venue with all buildings in sight.
  • building mode shows all the floors of a building as a stack. It is disabled by default. It can be enabled to display the floors as a stack (see multifloor view in example code). If disabled, all interactions described below go directly from global mode to floor mode and reverse.
  • floor mode shows a specific floor in detail.

  • View starts in the global mode
  • clicking on a building or on its name in the list will bring the camera to the selected building in building mode.
  • clicking on a floor will change the current floor on the stack, if in building mode, and then pass onto floor mode.
  • clicking the global button will bring you back to global mode

  • When routes are computed, stepping through instructions in building mode will only change the floor.
  • When routes are viewed in building mode, there is a Link that connects the routes through different floors.
Triggers signals: 'MultiBuildingView.exploreStateChanged', 'MultiBuildingView.exploreStateWillChange'

Constructor

new MultiBuildingView()

This object is constructed by setupMultiBuildingView
Since:
  • 1.8.3
See:

Members summary


Name Description
.DEFAULT value to indicate that one would like to go to the default floor or building.
buildingMarkerHeight distance above the ground building markers on the global view will be placed.
buildingMarkerScale scale size for building markers on the global view.
buildingModeEnabled Determines whether buildingMode should be allowed, otherwise it will only use global and floor mode.
buildingModelAnimationDurationDown duration in seconds for animating buildings going down.
buildingModelAnimationDurationUp duration in seconds for animating buildings going up.
buildingModePaddingFactor padding as a percentage of the border of the screen that the building mode view point should be calculated using getViewPointFromPositions(). values should range from 0 to 0.5.
buildingModePitch Camera pitch in degrees for building mode.
cameraPositionAnimationDuration duration in seconds for animating the camera position when changing modes, overridden if animationDuration is passed to goTo().
floorAnimationDuration duration in seconds for animating floors in and out, overridden if animationDuration is passed to goTo().
floorModePaddingFactor padding as a percentage of the border of the screen that the building mode view point should be calculated using getViewPointFromPositions(). values should range from 0 to 0.5.
floorModePitch Camera pitch in degrees for foo mode.
globalModePaddingFactor padding as a percentage of the border of the screen that global mode view point should be calculated using getViewPointFromPositions(). values should range from 0 to 0.5.
globalModePitch Camera pitch in degrees for global mode.
headingAnimationDuration duration in seconds for animating the camera heading when changing modes, overridden if animationDuration is passed to goTo().
pitchAnimationDuration duration in seconds for animating the camera pitch when changing modes, overridden if animationDuration is passed to goTo().
stackHeightFarAway distance above the ground that layers will be sent to, before they are hidden.

Methods summary


Name Description
animateHeading This method is used to animate the heading of the camera.
animatePitch This method is used to animate the pitch of the camera.
getCurrentExploreState returns the current explore state.
getCurrentFloor Returns the current floor.
getLocalizedName get the localized name for an ID
getVenueLayout get the venue's layout object describing venue's buildings and floors
goTo Goto a explore state. Triggers signals: 'MultiBuildingView.exploreStateWillChange' with arguments .target, .current and .view , and 'MultiBuildingView.exploreStateChanged' with arguments .current, .previous and .view
setCurrentFloor Sets the current floor and brings the camera to put it into view.

Members detail

(static, constant) .DEFAULT :string

value to indicate that one would like to go to the default floor or building.
See:
Example
multiBuildingView.goTo({
     mode: 'global',
        buildingID: multiBuildingView.DEFAULT,
        floorID: multiBuildingView.DEFAULT,
        animationDuration: 0
    });

buildingMarkerHeight :number

distance above the ground building markers on the global view will be placed.
Default Value:
  • 50

buildingMarkerScale :number

scale size for building markers on the global view.
Default Value:
  • 30

buildingModeEnabled :boolean

Determines whether buildingMode should be allowed, otherwise it will only use global and floor mode.
Default Value:
  • false

buildingModelAnimationDurationDown :number

duration in seconds for animating buildings going down.
Since:
  • 1.7.19
Default Value:
  • 0
See:

buildingModelAnimationDurationUp :number

duration in seconds for animating buildings going up.
Since:
  • 1.7.19
Default Value:
  • 0.7
See:

buildingModePaddingFactor :number

padding as a percentage of the border of the screen that the building mode view point should be calculated using getViewPointFromPositions(). values should range from 0 to 0.5.
Default Value:
  • 0.1

buildingModePitch :number

Camera pitch in degrees for building mode.
Default Value:
  • -20
See:

cameraPositionAnimationDuration :number

duration in seconds for animating the camera position when changing modes, overridden if animationDuration is passed to goTo().
Default Value:
  • 0.7
See:

floorAnimationDuration :number

duration in seconds for animating floors in and out, overridden if animationDuration is passed to goTo().
Default Value:
  • 1
See:

floorModePaddingFactor :number

padding as a percentage of the border of the screen that the building mode view point should be calculated using getViewPointFromPositions(). values should range from 0 to 0.5.
Default Value:
  • 0.1

floorModePitch :number

Camera pitch in degrees for foo mode.
Default Value:
  • -50
See:

globalModePaddingFactor :number

padding as a percentage of the border of the screen that global mode view point should be calculated using getViewPointFromPositions(). values should range from 0 to 0.5.
Default Value:
  • 0.0

globalModePitch :number

Camera pitch in degrees for global mode.
Default Value:
  • -50
See:

headingAnimationDuration :number

duration in seconds for animating the camera heading when changing modes, overridden if animationDuration is passed to goTo().
Default Value:
  • 0.7
See:

pitchAnimationDuration :number

duration in seconds for animating the camera pitch when changing modes, overridden if animationDuration is passed to goTo().
Default Value:
  • 0.7
See:

stackHeightFarAway :number

distance above the ground that layers will be sent to, before they are hidden.
Default Value:
  • 500

Methods detail

animateHeading(value, optionsopt) → {Promise}

This method is used to animate the heading of the camera.
Parameters:
Name Type Attributes Description
value number target rotation
options.durationInSeconds number <optional>
duration in seconds, if not constant degrees at 4 degrees per second.
options Object <optional>
Since:
  • 1.8.3
Returns:
where then(fulfilled(), rejected()) callbacks can be added.
Type
Promise
Example
multiBuildingView.animateHeading(30, {durationInSeconds: 2})
    .then(function() { ... update something}, function() { alert('error'); });

animatePitch(value, optionsopt) → {Promise}

This method is used to animate the pitch of the camera.
Parameters:
Name Type Attributes Description
value number target pitch
options Object <optional>
Properties
Name Type Attributes Description
durationInSeconds number <optional>
duration in seconds, if not constant degrees at 4 degrees per second.
Since:
  • 1.8.3
Returns:
where then(fulfilled(), rejected()) callbacks can be added.
Type
Promise
Example
multiBuildingView.animatePitch(-85, {durationInSeconds: 2})
    .then(function() { ... update 2D labels}, function() { alert('error'); });

getCurrentExploreState() → {Object}

returns the current explore state.
Since:
  • 1.7.17
Returns:
ExploreState
Type
Object

getCurrentFloor() → {string}

Returns the current floor.
Since:
  • 1.8.3
Returns:
if it is in global mode, it return the globalLayerID, otherwise the current exploreState floorID.
Type
string

getLocalizedName(id) → {string}

get the localized name for an ID
Parameters:
Name Type Description
id string
Since:
  • 1.8.3
Returns:
Type
string

getVenueLayout() → {Object}

get the venue's layout object describing venue's buildings and floors
Since:
  • 1.8.3
Returns:
Type
Object

goTo(exploreState) → {Promise}

Goto a explore state. Triggers signals: 'MultiBuildingView.exploreStateWillChange' with arguments .target, .current and .view , and 'MultiBuildingView.exploreStateChanged' with arguments .current, .previous and .view
Parameters:
Name Type Description
exploreState Object
Properties
Name Type Attributes Default Description
mode string <optional>
mode one of 'global', 'building', 'floor'
buildingID string <optional>
multiBuildingView.DEFAULT
floorID string <optional>
multiBuildingView.DEFAULT
place string <optional>
placeID If it is the same as the current floor, the done() function is called directly.
noViewpoint boolean <optional>
false if true the camera position will not be updated to default viewpoint for mode.
animationDuration number <optional>
default for cameraPositionDuration, pitchAnimationDuration and headingAnimationDuration Duration in seconds for cameraPosition, heading, and pitch animation, note that mapviewer.publicCamera.goTo has different signature.
cameraPositionAnimationDuration number <optional>
this.cameraPositionAnimationDuration Duration in seconds for animation of camera position change if any.
pitchAnimationDuration number <optional>
this.pitchAnimationDuration Duration in seconds for animation of camera pitch change if any.
headingAnimationDuration number <optional>
this.headingAnimationDuration Duration in seconds for animation of camera heading change if any.
floorAnimationDuration number <optional>
this.floorAnimationDuration Duration in seconds for animation of floors (same as animationDuration for changeFloor())
viewpoint Object <optional>
viewpoint that shows the whole floor or outside viewpoint has preference over place
Properties
Name Type Attributes Description
position Object <optional>
viewpoint has preference over place
pitch Object <optional>
optional pitch, otherwise use default for mode.
heading Object <optional>
optional heading, otherwise use one defined on footprint for building or outside layer.
Since:
  • 1.7.21 can specify the duration for pitch,heading, camera position, floor individually. Best just to update this.*animationDuration parameters.
Returns:
where then(fulfilled(), rejected()) callbacks can be added.
Type
Promise
Example
multiBuildingView.goTo({mode: 'global',animationDuration: 0});
    multiBuildingView.goTo({
    mode: 'building',
    buildingID: 'B2',
    animationDuration: 0.5})
    .then(function(){... update UI here ....});

    multiBuildingView.goTo({
        mode: 'global',
        buildingID: multiBuildingView.DEFAULT,
        floorID: multiBuildingView.DEFAULT,
        animationDuration: 0
    });

    multiBuildingView.goTo({
        mode: 'floor',
        floorID: 'B4-UL04',
        animationDuration: 0,
        viewpoint: {
            position: {x: -127.8117136719601, y: -135.464972367098, radius: 64.24722758526218}
        }
    });

setCurrentFloor(floorName, optionsopt) → {Promise}

Sets the current floor and brings the camera to put it into view.
Parameters:
Name Type Attributes Description
floorName string The floor to change to. If it is the same as the current floor, the done() function is called directly.
options Object <optional>
Additional options to change floor.
Properties
Name Type Attributes Default Description
animationDuration number <optional>
this.floorAnimationDuration Duration of the change floor animation in milliseconds like found in visioweb.Mapviewer, other animation durations are in seconds.
Since:
  • 1.8.3
Returns:
where then(fulfilled(), rejected()) callbacks can be added.
Type
Promise