Constructor
new VisioWebRemote(domElement, parameters)
constructor to create a new instance of VisioWebRemote
Parameters:
Name | Type | Description |
---|---|---|
domElement |
DOMElement | the iframe that will receive the VisioWeb instance |
parameters |
Object | a set of parameters to configure both UI and the VisioWeb instance |
- Since:
- 1.8.11
- See:
-
- full list of parameters.
Methods summary
Name | Description |
---|---|
ready | Registers a handler called when the visioweb instance is loaded and ready |
mouseup | Registers a handler called when the user clicks/taps on an interactive element. NB: - the 'mouseup' event must be included in parameters.mapview.events.listenTo for events to be forwarded to VisioWeb Remote. - only one handler can be defined: calling this method twice will replace the first handler with a new one. |
exploreStateWillChange | Registers a handler called when the explore state is about to change (changing floor/building). NB: - the 'exploreStateWillChange' event must be included in parameters.mapview.events.listenTo for events to be forwarded to VisioWeb Remote. - only one handler can be defined: calling this method twice will replace the first handler with a new one. |
exploreStateChanged | Registers a handler called when the explore state just changed (changing floor/building). NB: - the 'exploreStateChanged' event must be included in parameters.mapview.events.listenTo for events to be forwarded to VisioWeb Remote. - only one handler can be defined: calling this method twice will replace the first handler with a new one. |
createCategory | Registers a category. Can be called to add multiple categories by providing arrays. |
addCategory | Registers a category. Renamed into createCategory. |
addPlaceCategory | Adds a categoryID to a place. Can be called to add multiple categories to multiple places by providing arrays. |
setPlaceContent | Registers a place's content. Can be used to add multiple places by providing an array of parameters objects. |
addPlaceContent | Registers a place's content. Renamed into setPlaceContent. |
createPlace | Creates a place represented as an icon or a text in the map. Can be used to create multiple places by providing an array of parameters objects. |
getFootprintPoints | Retrieves the footprint(s) points for a given ID. |
getCategory | Retrieves the category's basic information for a given ID, including a number of places related to that category. |
getPlace | Retrieves the place's basic information for a given ID. |
getPointOfFocus | Retrieves the Point Of Focus object for a given ID. |
getVersion | Retrieves VisioWeb's version |
getViewpoint | Computes an optimal viewpoint for a given zone defined by a set of points expressed in local coordinates. |
goToBuilding | Animates to camera to a viewpoint showing a particular building. It also activates the building and shows its default floor. |
goToFloor | Animates to camera to a viewpoint showing a particular floor. It also activates the building thus making sure the floor is visible. |
goToGlobal | Animates to camera to the initial / global viewpoint. |
goToPlace | Animates to camera to center on a specific place. It also activates the place's building and floor thus making sure the place is visible. |
goToViewpoint | Animates to camera to the provided viewpoint. |
openSearch | Opens the search panel. |
queryAllCategoryIDs | Retrieves all category IDs used in the map. |
queryAllPlaceIDs | Retrieves all place IDs mentioned in the map. |
removePlace | Removes a place represented as an icon or a text on the map. |
resetPlaceColor | Restores the original color of a place, thus removing a potential highlight or temporary color. |
routeFrom | Sets a route start and computes a route if both start and destination are set. |
routeTo | Sets a route destination and computes a route if both start and destination are set. |
setParameters | Re-sets configuration parameters (they already have been set when instantiating VisioWeb Remote). Useful to adjust UI/UX to user input or to the map. e.g. use buttons by default, but revert to selectors if the map has many floors. If the some mapview configuration parameters are concerned, the map will be reloaded. |
setPlaceColor | Sets an alternate color to a place (as highlight, or temporarily). Can be applied to multiple places by providing arrays. |
setPlaceDescription | Sets a description for a place. It will be displayed in the place info component, if enabled. Can be applied to multiple places by providing arrays. |
setPlaceIcon | Sets an icon for a place. It will appear on the surface if a label slot exists. Can be applied to multiple places by providing arrays. |
setPlaceName | Sets a name for a place. It will appear on the surface if a label slot exists. Can be applied to multiple places by providing arrays. |
setPlacePosition | Moves to a new position a place represented as an icon or a text on the map. Can be applied to multiple places by providing arrays. |
Methods detail
ready(callback)
Registers a handler called when the visioweb instance is loaded and ready
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | the handler |
Example
var visioweb = new VisioWebRemote(document.getElementById('visioweb'), parameters);
visioweb.ready(() => {
console.log(visioweb.getVersion());
});
mouseup(callback)
Registers a handler called when the user clicks/taps on an interactive element.
NB:
- the 'mouseup' event must be included in parameters.mapview.events.listenTo for events to be forwarded to VisioWeb Remote.
- only one handler can be defined: calling this method twice will replace the first handler with a new one.
NB:
- the 'mouseup' event must be included in parameters.mapview.events.listenTo for events to be forwarded to VisioWeb Remote.
- only one handler can be defined: calling this method twice will replace the first handler with a new one.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | the handler |
- Since:
- 1.9.7
Example
var visioweb = new VisioWebRemote(document.getElementById('visioweb'), parameters);
visioweb.mouseup(element => {
console.log('clicked on: ' + element.id);
});
exploreStateWillChange(callback)
Registers a handler called when the explore state is about to change (changing floor/building).
NB:
- the 'exploreStateWillChange' event must be included in parameters.mapview.events.listenTo for events to be forwarded to VisioWeb Remote.
- only one handler can be defined: calling this method twice will replace the first handler with a new one.
NB:
- the 'exploreStateWillChange' event must be included in parameters.mapview.events.listenTo for events to be forwarded to VisioWeb Remote.
- only one handler can be defined: calling this method twice will replace the first handler with a new one.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | the handler |
- Since:
- 1.9.7
Example
var visioweb = new VisioWebRemote(document.getElementById('visioweb'), parameters);
visioweb.exploreStateWillChange(data => {
console.log('going to floor: ' + data.target.floorID + ' from floor: ' + data.current.floorID);
});
exploreStateChanged(callback)
Registers a handler called when the explore state just changed (changing floor/building).
NB:
- the 'exploreStateChanged' event must be included in parameters.mapview.events.listenTo for events to be forwarded to VisioWeb Remote.
- only one handler can be defined: calling this method twice will replace the first handler with a new one.
NB:
- the 'exploreStateChanged' event must be included in parameters.mapview.events.listenTo for events to be forwarded to VisioWeb Remote.
- only one handler can be defined: calling this method twice will replace the first handler with a new one.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | the handler |
- Since:
- 1.9.7
Example
var visioweb = new VisioWebRemote(document.getElementById('visioweb'), parameters);
visioweb.exploreStateChanged(data => {
console.log('arrived at: ' + data.current.floorID + ' from floor: ' + data.previous.floorID);
});
createCategory(parameters) → {Promise}
Registers a category.
Can be called to add multiple categories by providing arrays.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object |
Properties
|
- Since:
- 1.10.1
Returns:
- Type
- Promise
addCategory(parameters)
Registers a category. Renamed into createCategory.
Parameters:
Name | Type | Description |
---|---|---|
parameters |
Object |
- Since:
- 1.9.10
- Deprecated:
- Yes
- See:
addPlaceCategory(parameters) → {Promise}
Adds a categoryID to a place.
Can be called to add multiple categories to multiple places by providing arrays.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object |
Properties
|
- Since:
- 1.9.10
Returns:
- Type
- Promise
setPlaceContent(parameters) → {Promise}
Registers a place's content.
Can be used to add multiple places by providing an array of parameters objects.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object | Array.<Object> |
Properties
|
- Since:
- 1.10.1
Returns:
- Type
- Promise
addPlaceContent(parameters)
Registers a place's content. Renamed into setPlaceContent.
Parameters:
Name | Type | Description |
---|---|---|
parameters |
Object | Array.<Object> |
- Since:
- 1.10.0
- Deprecated:
- Yes
- See:
createPlace(parameters) → {Promise.<Object>}
Creates a place represented as an icon or a text in the map.
Can be used to create multiple places by providing an array of parameters objects.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object | Array.<Object> |
Properties
|
- Since:
- 1.9.10
- See:
-
- VisioWeb's addPOI for more options.
Returns:
fulfills with {id, floor, position} of the resulting place
- Type
- Promise.<Object>
getFootprintPoints(parameters) → {Promise.<Array.<Object>>}
Retrieves the footprint(s) points for a given ID.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
parameters |
Object |
Properties
|
Returns:
fulfills with an Array of {lat, lon} coordinates.
- Type
- Promise.<Array.<Object>>
getCategory(parameters) → {Promise.<Object>}
Retrieves the category's basic information for a given ID, including a number of places related to that category.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
parameters |
Object |
Properties
|
- Since:
- 1.9.10
Returns:
fulfills with {id, name, icon, nbPlaces}
- Type
- Promise.<Object>
getPlace(parameters) → {Promise.<Object>}
Retrieves the place's basic information for a given ID.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
parameters |
Object |
Properties
|
Returns:
fulfills with {id, floor, position: {lat, lon, height}}
- Type
- Promise.<Object>
getPointOfFocus(parameters) → {Promise.<Object>}
Retrieves the Point Of Focus object for a given ID.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
parameters |
Object |
Properties
|
Returns:
fulfills with {id, floor, position: {lat, lon, height}, heading}
- Type
- Promise.<Object>
getVersion() → {Promise.<string>}
Retrieves VisioWeb's version
Returns:
fulfills with version
- Type
- Promise.<string>
getViewpoint(parametersopt) → {Promise.<Object>}
Computes an optimal viewpoint for a given zone defined by a set of points expressed in local coordinates.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object |
<optional> |
if called without parameters, this method returns the current camera viewpoint
Properties
|
- See:
-
- VisioWeb's getViewpointFromPositions for more info.
Returns:
fulfills with {position: {lat, lon}, radius, pitch, heading}
- Type
- Promise.<Object>
goToBuilding(parameters) → {Promise}
Animates to camera to a viewpoint showing a particular building.
It also activates the building and shows its default floor.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
parameters |
Object |
Properties
|
Returns:
- Type
- Promise
goToFloor(parameters) → {Promise}
Animates to camera to a viewpoint showing a particular floor.
It also activates the building thus making sure the floor is visible.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
parameters |
Object |
Properties
|
Returns:
- Type
- Promise
goToGlobal() → {Promise}
Animates to camera to the initial / global viewpoint.
Returns:
- Type
- Promise
goToPlace(parameters) → {Promise}
Animates to camera to center on a specific place.
It also activates the place's building and floor thus making sure the place is visible.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object |
Properties
|
Returns:
- Type
- Promise
goToViewpoint(viewpoint) → {Promise}
Animates to camera to the provided viewpoint.
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
viewpoint |
Object |
Properties
|
Returns:
- Type
- Promise
openSearch() → {Promise}
Opens the search panel.
- Since:
- 1.9.10
Returns:
- Type
- Promise
queryAllCategoryIDs() → {Promise.<Array.<string>>}
Retrieves all category IDs used in the map.
Returns:
fulfills with an array of IDs
- Type
- Promise.<Array.<string>>
queryAllPlaceIDs() → {Promise.<Array.<string>>}
Retrieves all place IDs mentioned in the map.
Returns:
fulfills with an array of IDs
- Type
- Promise.<Array.<string>>
removePlace(parameters) → {Promise}
Removes a place represented as an icon or a text on the map.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
parameters |
Object |
Properties
|
Returns:
only succeeds for point-based Places (icons, texts), fails if the targeted place is linked to a physical surface.
- Type
- Promise
resetPlaceColor(parameters) → {Promise}
Restores the original color of a place, thus removing a potential highlight or temporary color.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
parameters |
Object |
Properties
|
Returns:
- Type
- Promise
routeFrom(parameters) → {Promise}
Sets a route start and computes a route if both start and destination are set.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
parameters |
Object |
Properties
|
- Since:
- 1.9.10
Returns:
- Type
- Promise
routeTo(parameters) → {Promise}
Sets a route destination and computes a route if both start and destination are set.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
parameters |
Object |
Properties
|
- Since:
- 1.9.10
Returns:
- Type
- Promise
setParameters(parameters) → {Promise}
Re-sets configuration parameters (they already have been set when instantiating VisioWeb Remote).
Useful to adjust UI/UX to user input or to the map.
e.g. use buttons by default, but revert to selectors if the map has many floors.
If the some mapview configuration parameters are concerned, the map will be reloaded.
Parameters:
Name | Type | Description |
---|---|---|
parameters |
Object |
- Since:
- 1.9.7
- See:
-
- full list of parameters.
Returns:
- Type
- Promise
setPlaceColor(parameters) → {Promise}
Sets an alternate color to a place (as highlight, or temporarily).
Can be applied to multiple places by providing arrays.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object |
Properties
|
Returns:
- Type
- Promise
setPlaceDescription(parameters) → {Promise}
Sets a description for a place.
It will be displayed in the place info component, if enabled.
Can be applied to multiple places by providing arrays.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object |
Properties
|
Returns:
- Type
- Promise
setPlaceIcon(parameters) → {Promise}
Sets an icon for a place.
It will appear on the surface if a label slot exists.
Can be applied to multiple places by providing arrays.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object |
Properties
|
Returns:
- Type
- Promise
setPlaceName(parameters) → {Promise}
Sets a name for a place.
It will appear on the surface if a label slot exists.
Can be applied to multiple places by providing arrays.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object |
Properties
|
Returns:
- Type
- Promise
setPlacePosition(parameters) → {Promise}
Moves to a new position a place represented as an icon or a text on the map.
Can be applied to multiple places by providing arrays.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object |
Properties
|
Returns:
only succeeds for point-based Places (icons, texts), fails if the targeted place is linked to a physical surface.
- Type
- Promise