Constructor#
new GuidedTour(itownsView, tourConfig, mediaConfig)#
It initializes the widget.
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
itownsView | itowns. | The itowns view. | ||||||||||||||||||
tourConfig | object | The configuration of the widget Properties
| ||||||||||||||||||
mediaConfig | Array.<Media> | All media of the tour |
Config Example { "steps": [ { "previous": 0, "next": 1, "layers": ["layer_1", "layer_2"], "media": [], "position": {"x": 10, "y": 20, "z": 30}, "rotation": {"x": 0.5, "y": 0, "z": 0.24, "w": 0} }, { "previous": 0, "next": 1, "layers": ["layer_3"], "media": ["media_1", "media_2"] } ], "name": "Example", "description": "This is an example of GuidedTour config", "startIndex": 0, "endIndex": 1 }
Classes#
Members#
currentIndex :number#
Index of the current step
- number
description :string#
Description of the GuidedTour
- string
domElement :HTMLElement#
Root html of GuidedTour view
- HTMLElement
endIndex :number#
Index of the last step of the GuidedTour
- number
itownsView :module:itowns~PlanarView#
- module:itowns~PlanarView
mediaConfig :Array.<object>#
Config of all media of the tour
- Array.<object>
mediaContainer :HTMLElement#
Html div containing media of the step
- HTMLElement
name :string#
Name of the GuidedTour
- string
nextButton :HTMLElement#
Button to go to next step
- HTMLElement
previousButton :HTMLElement#
Button to go to previous step
- HTMLElement
startIndex :number#
Index of the first step of the GuidedTour
- number
steps :Array.<object>#
Array of steps
- Array.<object>
Methods#
addMedia(mediaIds)#
Add media in the media container
Name | Type | Description |
---|---|---|
mediaIds | Array.<string> | The list of media IDs |
createMediaDiv(media) → {HTMLElement}#
Creates a HTML element from a media config
Name | Type | Description |
---|---|---|
media | Media | The media config |
The media as a HTML element
- Type:
- HTMLElement
dispose()#
Dispose the DOM element
filterLayers(layerIds)#
Filters layers, displaying only those whose ID appears in the list
Name | Type | Description |
---|---|---|
layerIds | Array.<string> | Array of layer IDs |
getCurrentStep() → {Step}#
Returns the current step of the tour
The current step of the tour
- Type:
- Step
getMediaById(mediaId) → {Media|null}#
Returns the media config with the matching ID
Name | Type | Description |
---|---|---|
mediaId | string | The ID of the media |
The media config
- Type:
- Media |
null
goToStep(index)#
Go to the step corresponding to the index
Name | Type | Description |
---|---|---|
index | number | Index of the step |
initHtml()#
Creates the HTML of the GuidedTour
travelToPosition(position, rotation)#
Travel to the targeted position and rotation
Name | Type | Description |
---|---|---|
position | object | Target postion |
rotation | object | Target rotation |