Guided Tours - Client
-
- UpdatedJan 30, 2025
- 4 minutes to read
- Yokohama
- API reference
The Guided Tours API provides methods for launching and stopping guided tours.
This API includes methods used in Guided Tour Designer.
Guided Tours - applyListFilter(Function filter_func)
Sets a function to retrieve filtered tour results when the
getAllTours()
method is called.
Complete signature includes
top.NOW.guided_tours.api
preceding the method name.
Name | Type | Description |
---|---|---|
filter_func | Function | Filter function that takes a single tour object from the
tours[] array returned from getAllTours()
method. |
Type | Description |
---|---|
None |
Example
The following example shows basic API usage.
Example
The following example shows how to use the options
field on the tour
object to add JSON with custom tour identifiers for reading and filtering tours inside the
filter_func()
function.
Guided Tours - endTour()
Stops a currently playing tour. This method silently exits if no tours are playing.
Complete signature includes
top.NOW.guided_tours.api
preceding the method name.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Null |
Example
Guided Tours - events.off(String event_name, Function listener_function)
Removes an existing event listener.
Complete signature includes
top.NOW.guided_tours.api
preceding the method name.
Name | Type | Description |
---|---|---|
event_name | String | Event name to be removed from the listener. Valid event names:
|
listener_function | Function | Optional. If provided, specified listener function is removed from remaining event listeners attached with that event. If not provided, all listener functions attached to that event are removed. |
Type | Description |
---|---|
None |
Example
Guided Tours - events.on(String event_name, Function listener_function)
Attaches an event listener to a guided tour event.
Complete signature includes
top.NOW.guided_tours.api
preceding the method name.
Name | Type | Description |
---|---|---|
event_name | String | Event name to be attached to the listener. Valid event names:
|
listener_function | Function | Listener to be added. Note: Clear any event listener after it solves its purpose. |
listener_function.obj | Object | Passed to listener_function() by each event in the following format:
JSON parameters:
|
Example
The following example shows basic API usage.
Example
The following example shows how to use the listener_function
parameter
with obj
as an argument.
Guided Tours - getAllTours(Function cb_function)
Gets a list of tours on the current page from which this method is called. Because this method is asynchronous, a callback function must be passed to determine operation success and get a list of tours.
Complete signature includes
top.NOW.guided_tours.api
preceding the method name.
Name | Type | Description |
---|---|---|
cb_function | Function | Callback function called by getAllTours() after attempt to
fetch all tours for the current page from which getAllTours()
method is called. |
cb_function.err | Object | Points to the error object if any occurred during the operation:
Null otherwise. |
cb_function.tours | Array | List of available tours for the page. If no tours are present on the page,
|
Type | Description |
---|---|
None |
Example
Guided Tours - loadPlayer()
Loads the guided tours player on a page in which guided tours player is not present by default.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
None |
Guided Tours - startTour(String tour_id, Number step_number, Function cb_function)
Starts a tour. Because this method is asynchronous, you must pass a callback function to determine operation success.
Complete signature includes
top.NOW.guided_tours.api
preceding the method name.
Type | Description |
---|---|
None |
Example
On this page
- Guided Tours - applyListFilter(Function filter_func)
- Guided Tours - endTour()
- Guided Tours - events.off(String event_name, Function listener_function)
- Guided Tours - events.on(String event_name, Function listener_function)
- Guided Tours - getAllTours(Function cb_function)
- Guided Tours - loadPlayer()
- Guided Tours - startTour(String tour_id, Number step_number, Function cb_function)