Wayfinder
events => WayfinderEvents
Trigger or listen to events. See WayfinderEvents class for more info.
search => WayfinderSearch
Search locations. See WayfinderSearch class for more info.
translator => Translator
Translator class
open(project : string)
Opens a project. Call this to initiate everything.
readProjectName()
Reads project name from URL
getProject() => string
Get the project name
getAPILocation() => string
Get the location where the API makes requests
setKiosk(ID : Number)
Set the Node which is focus point
getKiosk() => Number
Get the location where map is focused and where the path starts
getKioskNode() => NavigationNode
Get the NavigationNode of the current location
showPath(destination : NavigationNode, poi: POI?, options: Map?)
Show path to the given node (poi.getNode())
findPath(from : NavigationNode, to: NavigationNode)
Find path from a to b
showPathFromPOIToPOI(from : POI, to: POI)
Find path from POI a to POI b
showKiosk()
Show default view
showFloor(floor, callback)
Shows floor hiding all floors that are above given floor
getLanguage() => Language
Get current language
setLanguage(language : string)
Set current language
resize()
Resize manually the map view. Call after changing the canvas element dimensions
setZoom(percentage : float)
Set the map zoom level
zoomIn()
Increase map zoom by one step
zoomOut()
Decrease map zoom by one step
pathToText(path : array) => object
Translate path to human readable object
getPOIWithExternalId(id: string) => POI
Find a POI with given external room id
getNearestPOI(source : Node, list : Array, ) => POI
Get the nearest POI from the given POIs list
restoreDefaultState()
Restore default state – kiosk view, default language, clear highlights
setHighlights(poi_list : Array)
Highlight list of POIs
clearHighlights()
Removes highlight from previously highlighted locations
setDisplaying(poi_list : Array)
Display list of POIs
clearDisplaying()
Removes previously displaying locations
getLanguages() => Array
Returns list of languages
getPOIs() => Object
Returns list of POIs
getPOIArray() => Array
Returns array of POIs
getPOIGroups() => Array
Returns list of POI groups
getShortcuts() => Array
Returns shortcuts groups
getMainGroups() => Array
Return only groups with no parent
getGroupTree => Object
Generates a Tree of groups
getShortcuts => Array
Returns groups which are assigned as shortcut (toilets, exits etc)
getNodes() => Array
Returns list of Nodes
getEdges() => Array
Returns list of edges
run()
Run map when paused
pause()
Pause map when running
clearPath()
Clear the path
getScreenPosition(poi: POI) => Vec2
Get the given POIs location on the screen
getNearestPOIs(source, pois, radius) => Array
Finds nearest poi to given source in given radius. Limit search to given pois.
getRoom(id) => Room
Returns a room with a list of POIs
getGroupWithSlug(slug) => POIGroup
Returns a group with a given slug.
display (poi)
Distplay the given POI. Sets the following parameters: floor, highlight, displaying
POI
Provides access to POI info.
getID() => int
Returns POI id
getSetting(key, default?) => Setting
Return POIs given setting. If not defined return global value.
hasSetting(key) => boolean
Checks if POI has setting defined
getName(language : string) => string
Returns POIs name for given language
getNames() => object
Returns POIs translations {“en”: “Name”}
hasName(language) => boolean
Check if POI name is set in given language
getFirstChar(language) => string
Returns lowercase first letter of POIs name
getDescription(language : string) => string
Returns POIs description for given language
getDescriptions() => object
Returns POIs descriptions {“en”: “Description”}
getOpeningHours(language: string) => string
Returns opening hours
getShowInMenu() => boolean
Returns if the POI should displayed in the menu
setShowInMenu(value)
Set if POI should be shown in the menu or not
getFloor() => Floor
Get the POIs floor
getNode() => Node
Returns POIs Node
getGroups() => Array
Returns POIs groups
addGroup(group: Group)
Add group to POI
getGroupNames(language) => Object
Gets translations in given language of names of all groups
getAdvertisements()
Get POIs advertisements
getTags() => string
Returns POIs tags
getIcon() => Image
Returns POIs icon
getIconUrl() => String
Returns POIs icon url
getBackground() => Image
Returns POIs background image
getBackgroundUrl() => String
Returns POIs background image url
getRoomId() => string
Returns POIs external room id
isAlwaysVisible() => boolean
If POI is always shown
getSetting(key, default) => any
Returns POI specific setting
getSettingBoolean(key, default) => boolean
Returns POI specific boolean setting
getSettingFloat(key, default) => float
Returns POI specific float setting
hasSetting(key) => boolean
Returns true if the setting is set
getAttribute(key: string) => Attribute
Get given POI attribute
hasAttribute (key: string) => boolean
Check if POI has attribute defined
getAttributeString (key: string) => string
Get string value of attribute
getAttributeJSON (key: string) => Object
Get JSON value of attribute
POIGroup
Provides access to POI group info.
getID() => int
Returns groups id
getNames() => Object
Returns groups list of names
getName(language : string) => string
Returns group name for given language
getDescription(language: string) => String
Returns group description for given language
getDescriptions() => Object
Returns group description translations {“en”: “Description”}
getShowInMenu() => boolean
Returns if group is shown in the menu
getShowInTopMenu() => boolean
Returns if group should be shown in the top hot topics menu
getImageID() => int
Returns group image id
getPOIs() => Array
Returns group POIs
addPOI(poi: POI)
Add POI to group
getColor() => Color
Returns group color
getIconUrl() => string
Returns group icon url
getChildren() => Array
Returns group children id’s
getParent() => POIGroup
Returns group parent if set else null
Floor
Provides access to floor info and Nodes/POIs related to this floor.
getID() => int
Returns floor id
getName(language : string) => string
Returns floor name for given language
getNames() => Array
Returns list of names
getPOIs() => Array
Returns list of POIs on this floor
getNodes() => Array
Returns list of Nodes on this floor
getShowInMenu() => boolean
Is floor hidden or not
Building
Provides access to Building info.
getFloors() => Array
Gets all floors of the building as an object
getSortedFloors() => Array
Gets all floors sorted by index as an array
getCurrentFloor() => Floor
Get current active floor
setCurrentFloor(floor: Floor)
Set current floor
Settings
Provides access Wayfinder Settings
has(key: string)
Check if setting exists
get(key: string, defaultValue: any)
Returns a setting by key ‘as is’.
getInt(key: string, defaultValue)
Returns a setting by key as integer.
getFloat(key: string, defaultValue)
Returns a setting by key as float.
getColor(key: string, defaultValue)
Returns a setting by key as color.
getBoolean(key: string, defaultValue)
Returns a setting by key as boolean.
set(key: string, value)
Sets a setting value.
NavigationNode
Provides access to node info (3D position, rotation, type) and POIs related to this node.
getID() => int
Get Node id
getFloor() => Floor
Get Floor where the Node is set
getPOIs() => Array
Get POIs attached to this Node
Language
Language representation (holds translations)
getName() => string
Name of this language (unique name, not translated name)
getNativeName() => string
Native name of this language (Deutch, Eesti keel)
getID() => int
ID of this language
getTextDirection() => string
WayfinderEvents
Event class
on(type: string, callback: function)
Start listening to given event
once(type: string, callback: function)
Trigger event only once
Defined events
map-click: Called when map is clicked/touched
map-pause: Called when map is paused
map-run: Called when map is run
map-ready: Called when map is ready for input
language-change: Called when language changes
data-loaded: Called when basic data is loaded
location-start: Started acquiring location
location-change: Called when location has changed
location-success: First position found
location-failed: Positioning failed
pre-ready: Called before url parsing parameters
ready: Everything done
WayfinderSearch
Search class
overrideOptions(options: Object)
Override search options
clearResults()
Clear previous results
search(searchstring: string)
Search pois with given string
findWithChar(character: string)
Search pois with given char