Logo
Developer

VisioWeb Essential 1.17.2

Class

Content

VisioWebEssential's Content module dedicated to business data management (place names, categories) and interactions with the map.

Constructor

new Content()

Since:
  • 1.10.0

Members summary


Name Description
categories The categories collection.
It will receive the categories embedded in the map's extra data and it can be later completed by the developer using addPlaceCategory.
places The places collection.
It will receive the places embedded in the map's extra data and it can be later completed by the developer using setPlaceContent.
activePlace The active place i.e. the place that the user selected either by interacting with it on the map or by selecting it in a search result.
placeBubbleId ID of the HTML element used to display a bubble anchored on the active place.
placeBubbleEnabled Whether the place bubble is enabled. If false, the developer needs to design its own 'place info' UI component to display the active place's information.
activePlaceID The active place's ID

Methods summary


Name Description
createCategory Registers a new category for places to be later assigned to places using addPlaceCategory.
addPlaceCategory Assigns a category to a place. The category needs to exist or to be registered first using createCategory.
setPlaceContent Registers a place's content. The input id needs to refer to an existing surface-like or point-like place in the map.
createPlace VisioWeb does not allow developers to create surface-like places but it does enable you to create point-like places.
It can be an icon, a text or both. See VisioWeb's Mapviewer#addPOI method for more details.
getPlace Retrieves a place's data for a given id.
getCategory Retrieves a category's data for a given id.
setActivePlace Sets the currently active place.
setHighlightedPlace Sets the currently highlighted place.
setPlaceColor Allows you to set the color of a surface-like place.
setPlaceDescription Allows you to set a place's description.
setPlaceIcon Allows you to set a place's icon and update it both in Content's data and on the map itself.
setPlaceName Allows you to set a place's name and update it both in Content's data and on the map itself.
setPlacePosition Allows you to set or move the position of a point-like place (icon, text).
queryAllPlaceIDs Returns the array of all the place IDs including both surface-like and point-like places.
queryAllCategoryIDs Returns the array of all the registered category IDs
removePlace VisioWeb does not allow developers to remove surface-like places but it does enable you to remove point-like places.
resetActivePlace Resets the active place, i.e. sets activePlace to null and restores the original color of the corresponding surface(s).
resetHighlightedPlace Resets the highlighted place, i.e. restores the original color of the corresponding surface(s).
resetPlaceColor Allows you to restore the original color of a surface-like place.

Members detail

categories :Object

The categories collection.
It will receive the categories embedded in the map's extra data and it can be later completed by the developer using addPlaceCategory.
Since:
  • 1.10.0

places :Object

The places collection.
It will receive the places embedded in the map's extra data and it can be later completed by the developer using setPlaceContent.
Since:
  • 1.10.0

activePlace :Object

The active place i.e. the place that the user selected either by interacting with it on the map or by selecting it in a search result.
Since:
  • 1.10.0

placeBubbleId :string

ID of the HTML element used to display a bubble anchored on the active place.
Since:
  • 1.10.0

placeBubbleEnabled :boolean

Whether the place bubble is enabled. If false, the developer needs to design its own 'place info' UI component to display the active place's information.
Since:
  • 1.10.0

activePlaceID :string

The active place's ID
Since:
  • 1.10.0

Methods detail

createCategory(arguments)

Registers a new category for places to be later assigned to places using addPlaceCategory.
Parameters:
Name Type Description
arguments Object
Properties
Name Type Description
id string category's id
name string category's name
icon string category's icon URL
Since:
  • 1.10.0
See:

addPlaceCategory(arguments)

Assigns a category to a place. The category needs to exist or to be registered first using createCategory.
Parameters:
Name Type Description
arguments Object
Properties
Name Type Attributes Description
id string place's id
categoryID string category's id
updateFunction function <optional>
custom update function to update this place's entry in Content's data while preserving potential additional properties (e.g. if VisioWebEssential's Content is observed as a reactive data by an application, like our VueJS sample app and its vuex store).
Since:
  • 1.10.0
See:

setPlaceContent(arguments)

Registers a place's content. The input id needs to refer to an existing surface-like or point-like place in the map.
Parameters:
Name Type Description
arguments Object
Properties
Name Type Attributes Description
id string place's id
name string place's id
categories Array.<string> <optional>
place's categories as an array of category IDs
floor string <optional>
place's floor
description string <optional>
place's description
updateFunction function <optional>
custom update function to update this place's entry in Content's data while preserving potential additional properties (e.g. if VisioWebEssential's Content is observed as a reactive data by an application, like our VueJS sample app and its vuex store).
Since:
  • 1.10.0

createPlace(arguments) → {Object}

VisioWeb does not allow developers to create surface-like places but it does enable you to create point-like places.
It can be an icon, a text or both. See VisioWeb's Mapviewer#addPOI method for more details.
Parameters:
Name Type Description
arguments Object
Properties
Name Type Attributes Description
parameters Array.<Object> the input set of parameters provided as {position: {lat, lon[, height]}[, floor, id, ...]}
updateFunction function <optional>
custom update function to update this place's entry in Content's data while preserving potential additional properties (e.g. if VisioWebEssential's Content is observed as a reactive data by an application, like our VueJS sample app and its vuex store).
Since:
  • 1.10.0
See:
Returns:
{id, floor, position: {lat, lon, height}}
Type
Object
Example
essential.content.createPlace({
 parameters: {
     position: {
         lat: 48.58136,
         lon: 2.65166
     },
     floor: 'B0-UL01',
     id: 'my-place-01',
     url: '../media/test.png',
     text: 'this is my place',
     scale: 10
 }
});

getPlace(arguments) → {Object}

Retrieves a place's data for a given id.
Parameters:
Name Type Description
arguments Object
Properties
Name Type Description
id string place's id
Since:
  • 1.10.0
Returns:
{id, name, categories, description, floor, position}
Type
Object

getCategory(arguments) → {Object}

Retrieves a category's data for a given id.
Parameters:
Name Type Description
arguments Object
Properties
Name Type Description
id string category's id
Since:
  • 1.10.0
Returns:
{id, name, icon}
Type
Object

setActivePlace(arguments) → {Promise}

Sets the currently active place.
Parameters:
Name Type Description
arguments Object
Properties
Name Type Description
place string | Place the target place's ID or Place object
Since:
  • 1.10.0
Returns:
Type
Promise

setHighlightedPlace(arguments)

Sets the currently highlighted place.
Parameters:
Name Type Description
arguments Object
Properties
Name Type Description
place string | Place the target place's ID or Place object
Since:
  • 1.10.0

setPlaceColor(arguments)

Allows you to set the color of a surface-like place.
Parameters:
Name Type Description
arguments Object
Properties
Name Type Description
id string the target place's ID
color string | number the expected color as hexadecimal, e.g. 0x00ff00, or CSS-style string '#00ff00'.
Since:
  • 1.10.0

setPlaceDescription(arguments)

Allows you to set a place's description.
Parameters:
Name Type Description
arguments Object
Properties
Name Type Attributes Description
id string the target place's ID
description string the new description
updateFunction function <optional>
custom update function to update this place's entry in Content's data while preserving potential additional properties (e.g. if VisioWebEssential's Content is observed as a reactive data by an application, like our VueJS sample app and its vuex store).
Since:
  • 1.10.0

setPlaceIcon(arguments)

Allows you to set a place's icon and update it both in Content's data and on the map itself.
Parameters:
Name Type Description
arguments Object
Properties
Name Type Attributes Description
id string the target place's ID
url string the new icon URL
updateFunction function <optional>
custom update function to update this place's entry in Content's data while preserving potential additional properties (e.g. if VisioWebEssential's Content is observed as a reactive data by an application, like our VueJS sample app and its vuex store).
Since:
  • 1.10.0

setPlaceName(arguments)

Allows you to set a place's name and update it both in Content's data and on the map itself.
Parameters:
Name Type Description
arguments Object
Properties
Name Type Attributes Description
id string the target place's ID
name string the new name
parameters Object <optional>
additional parameters.
updateFunction function <optional>
custom update function to update this place's entry in Content's data while preserving potential additional properties (e.g. if VisioWebEssential's Content is observed as a reactive data by an application, like our VueJS sample app and its vuex store).
Since:
  • 1.10.0
See:

setPlacePosition(arguments)

Allows you to set or move the position of a point-like place (icon, text).
Parameters:
Name Type Description
arguments Object
Properties
Name Type Description
id string the target place's ID
position Object the expected position provided as {lat, lon, height}.
Since:
  • 1.10.0

queryAllPlaceIDs() → {Array.<string>}

Returns the array of all the place IDs including both surface-like and point-like places.
Since:
  • 1.10.0
Returns:
Type
Array.<string>

queryAllCategoryIDs() → {Array.<string>}

Returns the array of all the registered category IDs
Since:
  • 1.10.0
Returns:
Type
Array.<string>

removePlace(arguments)

VisioWeb does not allow developers to remove surface-like places but it does enable you to remove point-like places.
Parameters:
Name Type Description
arguments Object
Properties
Name Type Description
id string the target place's ID
Since:
  • 1.10.0

resetActivePlace()

Resets the active place, i.e. sets activePlace to null and restores the original color of the corresponding surface(s).
Since:
  • 1.10.0

resetHighlightedPlace()

Resets the highlighted place, i.e. restores the original color of the corresponding surface(s).
Since:
  • 1.10.0

resetPlaceColor(arguments)

Allows you to restore the original color of a surface-like place.
Parameters:
Name Type Description
arguments Object
Properties
Name Type Description
id string the target place's ID
Since:
  • 1.10.0