Skip to main content

LivemapSDK

This class represents an Embed of a Livemap and allows the developper to interact with it.

Constructors

Constructor

new default(container, options, iframeEmbed?): Livemap

This class is used to create a new livemap When you do wemap.v1.createLivemap(container, options, useIframe), this is the class used behind, then you are allowed to use this class to interact with the livemap

Parameters

container

HTMLElement

Container of the livemap

options

any

Options of the Livemap (emmid & token entries are mandatory)

iframeEmbed?

boolean = true

Set to false if you want the livemap in the dom

Returns

Livemap

Properties

onLoadError

onLoadError: () => Promise<void>

Triggered when an error occurs when loading the map

Returns

Promise<void>

a promise that resolves if an error occurs when loading the map

Example

livemap.onLoadError().then(() => {
console.log('onLoadError');
});

Methods

addEventListener()

addEventListener(eventName, callback): any

Register a listener for a specific event type. You can find every listener below with the data it receives.

Parameters

eventName

"ready" | "mapUpdate" | "mapClick" | "mapLongClick" | "contentUpdated" | "floorChanged" | "indoorLevelsChanged" | "indoorLevelChanged" | "permissionsDenied" | "actionButtonClick" | "autoplayStart" | "autoplayStop" | "pinpointClick" | "pinpointOpen" | "pinpointClose" | "multipointOpen" | "multipointClose" | "userLogin" | "userLogout" | "inaccurateMagnetometer" | "eventOpen" | "eventClose" | "listOpen" | "listClose" | "livemapMoved" | "mapMoved" | "indoorFeatureClick" | "pageChanged" | "arEnabled" | "arDisabled" | "guidingStarted" | "guidingUpdated" | "guidingStopped" | "deviceAttitudeUpdated" | "userLocationUpdated" | "fullscreenEnter" | "fullscreenExit"

Name of event

callback

CallbackListener

Callback to receive the events

Returns

any

a promise that resolves if no exception is raised.

Examples

livemap.addEventListener('arEnabled', function() {
});
livemap.addEventListener('arDisabled', function() {
});
livemap.addEventListener('contentUpdated', function(data) {
// data: {
// type: 'pinpoints' | 'events'
// items: Array<Pinpoint | Event>,
// query: {
// query: string
// minaltitude: number
// maxaltitude: number
// tags: Array<string>
// bounds: BoundingBox
// }
// }
});
livemap.addEventListener('pinpointClick', function() {
});
livemap.addEventListener('floorChanged', function(data) {
// data: {
// floor: Floor
// }
});
livemap.addEventListener('permissionsDenied', function(data) {
// data: {
// permissions: string[]
// }
});
livemap.addEventListener('deviceAttitudeUpdated', function(data) {
// data: {
// attitude: Attitude
// }
});
livemap.addEventListener('userLocationUpdated', function(data) {
// data: {
// userLocation: UserLocation
// }
});
livemap.addEventListener('actionButtonClick', function(data) {
// data: {
// item: Pinpoint | Event,
// actionType: 'NAME_OF_ACTION',
// itemType: 'pinpoint' | 'event'
// }
});
livemap.addEventListener('pinpointOpen', function(data) {
// data: { pinpoint: Pinpoint }
});
livemap.addEventListener('pinpointClose', function() {
});
livemap.addEventListener('eventOpen', function(data) {
// data: { event: Event }
});
livemap.addEventListener('eventClose', function() {
});
livemap.addEventListener('multipointOpen', function(data) {
// data: {
// latitude: number,
// longitude: number,
// pinpoints: Array<Pinpoint>,
// events: Array<Event>
// }
});
livemap.addEventListener('multipointClose', function() {
});
livemap.addEventListener('listOpen', function(data) {
// data: { list: List }
});
livemap.addEventListener('listClose', function() {
});
livemap.addEventListener('mapMoved', function(data) {
// data: {
// zoom: number,
// bounds: {
// northEast: {
// latitude: number,
// longitude: number
// },
// southWest: {
// latitude: number,
// longitude: number
// }
// },
// latitude: number,
// longitude: number
// }
});
livemap.addEventListener('mapClick', function(data) {
// data: {
// latitude: number,
// longitude: number
// }
});
livemap.addEventListener('mapLongClick', function(data) {
// data: {
// latitude: number,
// longitude: number
// }
});
livemap.addEventListener('guidingStarted', function() {
});
livemap.addEventListener('guidingUpdated', function(data) {
// data: {
// remainingDistance: number
// }
});
livemap.addEventListener('guidingStopped', function() {
});
livemap.addEventListener('fullscreenEnter', function() {
});
livemap.addEventListener('fullscreenExit', function() {
});

addMarker()

addMarker(marker): Promise<Marker & object>

Add marker to the map

Parameters

marker

Marker

marker to add on map

Returns

Promise<Marker & object>

a promise which resolves with the marker with the id generated for the marker This id can be used to remove the marker

Example

const marker = {
coordinates: {
latitude: 43.609138,
longitude: 3.884193
},
img: 'http://1.bp.blogspot.com/_2IU2Nt4rD1k/S7NYdiVpUeI/AAAAAAAABRY/YWJbdCPlllI/s400/Eiffel_Tower.JPG'
};
livemap.addMarker(marker);

See

removeMarker to remove the marker with its id.


animateMarker()

animateMarker(ppid, animation, duration): Promise<void>

Animate a marker

Parameters

ppid

number

Id of pinpoint

animation

"bounce" | "scale"

name of animation, currently available (bounce|scale)

duration

number

duration of animation in ms

Returns

Promise<void>

a promise that resolves when animation is fired

Example

var ppid = 1234;
var animation = "bounce";
var duration = 2000;
livemap.animateMarker(ppid, animation, duration);

aroundMe()

aroundMe(): Promise<void>

Center the map on the user's location.

Returns

Promise<void>

a promise that resolves if no exception is raised.

Example

livemap.aroundMe();

centerTo()

centerTo(center, zoom, animate): Promise<void>

Center the map on the given position and set the zoom level.

Parameters

center

Coordinates

New center

zoom

number

New zoom level

animate

boolean

Whether to animate the map movement

Returns

Promise<void>

a promise that resolves if no exception is raised.

Example

var center = { latitude: 43.609395, longitude: 3.884215 };
var zoom = 13;
livemap.centerTo(center, zoom);

changeFloor()

changeFloor(floor): Promise<void>

Change the floor displayed on the map.

Parameters

floor

string

Returns

Promise<void>

a promise which resolves when the action has been sent to the Livemap.

Example

const floor = '1';
livemap.changeFloor(floor);

closeEvent()

closeEvent(): Promise<void>

Close the current opened event. Go to the search view.

Returns

Promise<void>

a promise that resolves if no exception is raised.

Example

livemap.closeEvent();

closeList()

closeList(): Promise<void>

Close the current opened list. Go to the search view.

Returns

Promise<void>

a promise that resolves if no exception is raised.

Example

livemap.closeList();

closePinpoint()

closePinpoint(): Promise<void>

Close the current opened pinpoint. Go to the search view.

Returns

Promise<void>

a promise that resolves if no exception is raised.

Example

livemap.closePinpoint();

closePopin()

closePopin(): Promise<void>

Close the current opened popin

Returns

Promise<void>

a promise that resolves if no exception is raised.

Example

livemap.closePopin();

directionToPinpoint()

directionToPinpoint(pinpointId): Promise<void>

Display direction to a pinpoint.

Parameters

pinpointId

number

Id of the destination pinpoint.

Returns

Promise<void>

a promise that resolves once the direction is displayed.

Example

var pinpointId = 1234;
livemap.directionToPinpoint(pinpointId)

disableAnalytics()

disableAnalytics(): Promise<void>

Disable analytics tracking

Returns

Promise<void>

Example

livemap.disableAnalytics()

disablePositioningSystem()

disablePositioningSystem(): Promise<void>

Disable the inner positioning system You can still use setUserLocation to set the user location and use your own positioning system

Returns

Promise<void>

a promise that resolves if no exception is raised.


disableSidebar()

disableSidebar(): Promise<void>

Disable sidebar.

Returns

Promise<void>

Example

livemap.disableSidebar()

drawPolyline()

drawPolyline(coordinates, options?): any

Parameters

coordinates

Coordinates[]

Array of coordinates

options?

Options for the polyline

color?

string

Color of the polyline. Default is wemap color (#2F7DE1)

opacity?

number

Opacity of the polyline. Default is 0.8

useNetwork?

boolean

If true, the itinerary service will be used to draw the polyline.

width?

number

Width of the polyline. Default is 4

Returns

any

a promise that resolves with the id and the geometry (geojson LineString) of the polyline created if no error is raised. This is a temporary unique id that can be used to remove the polyline.

Description

Draw a polyline on the map between multiple coordinates. You can either draw a raw array of coordinates or use our itinerary service to draw a route between multiple points.

Examples

livemap.drawPolyline([{latitude: 43.3, longitude: 3.2}, {latitude: 43.2, longitude: 3.1}, {latitude: 43.3, longitude: 3.1}]);
livemap.drawPolyline([{latitude: 43.3, longitude: 3.2}, {latitude: 43.2, longitude: 3.1}], { useNetwork: true });
livemap.drawPolyline([{latitude: 43.3, longitude: 3.2}, {latitude: 43.2, longitude: 3.1}], { color: '#FF0000', width: 5, opacity: 0.5 });

See

removePolyline to remove the polyline with its id.


easeTo()

easeTo(options): Promise<void>

Set the map's geographical center.

Parameters

options

EaseToOptions

Ease to options

Returns

Promise<void>

a promise that resolves if no exception is raised.

Example

livemap.easeTo({center: {latitude: 43, longitude: 3}, zoom: 9, duration: 5000});

enableAnalytics()

enableAnalytics(): Promise<void>

Enable analytics tracking

Returns

Promise<void>

Example

livemap.enableAnalytics()

enableSidebar()

enableSidebar(): Promise<void>

Enable sidebar.

Returns

Promise<void>

Example

livemap.enableSidebar()

findNearestPinpoints()

findNearestPinpoints(options): Promise<Pinpoint[]>

Find the nearest pinpoints from a point.

Parameters

options

Options for the search. Available options are: center.

center

Coordinates

center for the search.

Returns

Promise<Pinpoint[]>

a promise that resolves with the nearest pinpoints.

Example

var center = { latitude: 43.609395, longitude: 3.884215 };
livemap.findNearestPinpoints({ center: center })
.then(function(pinpoints) {
// do something
});

fitBounds()

fitBounds(bounds, options?): any

Fit the map on given bounds.

Parameters

bounds

[number, number, number, number]

[W,S,E,N] Coordinates bounds to fit on.

options?

Options for the action. Available options are: padding.

animate?

boolean

If animation should occur

padding?

{ bottom: number; left: number; right: number; top: number; }

{bottom, top, left, right} padding to add to bounds.

padding.bottom

number

padding.left

number

padding.right

number

padding.top

number

Returns

any

a promise that resolves if no exception is raised.

Example

var bounds = [2.294481, 43.609138, 3.884193, 48.85837];
var options = {
padding: {
top: 65
}
};
livemap.fitBounds(bounds, options);

getCenter()

getCenter(): Promise<Coordinates>

Return the map's geographical center.

Returns

Promise<Coordinates>

a promise that resolves with the map center.

Example

livemap.getCenter().then(function(center) {
// Do something with center
});

getCurrentFloor()

getCurrentFloor(): Promise<Floor | undefined>

Get current floor displayed

Returns

Promise<Floor | undefined>

a promise which resolves with the current floor or null if the map has no floors.

Example

livemap.getCurrentFloor().then(function(floor) {
console.log(floor);
});

getDeviceAttitude()

getDeviceAttitude(): any

Get the device attitude. The promise resolve with null if the livemap is not listening on device attitude.

Returns

any

a promise which resolves with the device heading if no error occured.

Example

livemap.getDeviceAttitude().then(function(attitude) {
// Do something with attitude
});

getDeviceHeading()

getDeviceHeading(): any

Get the user heading. The promise resolve with null if the livemap is not listening on user heading.

Returns

any

a promise which resolves with the user heading if no error occured.

Example

livemap.getDeviceHeading().then(function(heading) {
// Do something with heading
});

getFloors()

getFloors(): Promise<Floor[]>

Get floors available on the map

Returns

Promise<Floor[]>

a promise which resolves with the floors available on the map.

Example

livemap.getFloors().then(function(floors) {
console.log(floors);
});

getIndoorLevel()

getIndoorLevel(): Promise<IndoorLevelType>

Get current indoor level

Returns

Promise<IndoorLevelType>

a promise which resolves with current indoor level if no error occured

Example

livemap.getIndoorLevel().then(function(indoorLevel) {
console.log(indoorLevel);
});

getIndoorLevels()

getIndoorLevels(): Promise<IndoorLevelType[]>

Get all indoor levels

Returns

Promise<IndoorLevelType[]>

a promise which resolves with all indoor levels if no error occured

Example

livemap.getIndoorLevels().then(function(indoorLevels) {
console.log(indoorLevels);
});

getTagsConfiguration()

getTagsConfiguration(): Promise<UseTags>

Get tags and category configuration

Returns

Promise<UseTags>

a promise that resolves with the tags configuration.

Example

livemap.getTagsConfiguration();

getUserLocation()

getUserLocation(): Promise<UserLocation>

Get the user location. Return a promise with the user location if the user accepts to share his location.

Returns

Promise<UserLocation>

a promise which resolves with the user location is no error occured.

Example

livemap.getUserLocation().then(function(location) {
// Do something with location
});

getZoom()

getZoom(): Promise<number>

Return the map's zoom level.

Returns

Promise<number>

a promise that resolves with the current zoom level.

Example

livemap.getZoom().then(function(zoom) {
// Do something with zoom
});

highlightPinpoints()

highlightPinpoints(pinpointsId): any

Highlight pinpoints on the map

Parameters

pinpointsId

number[]

Pinpoints to highlight the map.

Returns

any


navigateFromPinpointToPinpoint(startPinpoint, endPinpoint): Promise<void>

Start the navigation between two given pinpoints.

Parameters

startPinpoint

Pinpoint

Pinpoint representing the start location.

endPinpoint

Pinpoint

Destination pinpoint

Returns

Promise<void>

Example

var startPinpoint = {
id: 1234,
latitude: 43.609395,
longitude: 3.884215
};

var endPinpoint = {
id: 1234,
latitude: 43.6094,
longitude: 3.884789
};
livemap.navigateFromPinpointToPinpoint(startPinpoint, endPinpoint);

navigateToPinpoint(ppid, startLocation?, initialHeading?): Promise<void>

Start navigation to a pinpoint. Can be an absolute navigation (start location based on phone sensors) or a relative navigation (given start location & heading). If start location and initialHeading are not provided, the navigation will start with the user location

Parameters

ppid

number

Id of the destination pinpoint.

startLocation?

Coordinates | null

For relative navigation only. Navigation start location { lat, lng, alt }.

initialHeading?

number | null

For relative navigation only. Navigation start heading (in degrees).

Returns

Promise<void>

a promise that resolves once the navigation is correctly started.

Examples

var pinpointId = 1234;
livemap.navigateToPinpoint(pinpointId)
var pinpointId = 1234;
var startLocation = { latitude: 43.609395, longitude: 3.884215 };
var initialHeading = 190;
livemap.navigateToPinpoint(pinpointId, startLocation, initialHeading)

openEvent()

openEvent(eid): Promise<void>

Open an event on the map. This can only be used for maps which use events.

Parameters

eid

number

Event ID

Returns

Promise<void>

a promise that resolves if no exception is raised.

Example

var eid = 1234;
livemap.openEvent(eid);

openList()

openList(lid): Promise<void>

Open a list on the map.

Parameters

lid

number

List ID

Returns

Promise<void>

a promise that resolves if no exception is raised.

Example

var lid = 1234;
livemap.openList(lid);

openLivebar()

openLivebar(type?): Promise<void>

Open the livebar with a given type. ('LIST' | 'HORIZONTAL_LIST')

Parameters

type?

"LIST" | "HORIZONTAL_LIST"

Returns

Promise<void>

a promise that resolves if no exception is raised.

Examples

livemap.openLivebar(); // default: 'LIST'
livemap.openLivebar('HORIZONTAL_LIST');

openPinpoint()

openPinpoint(pid, options?): Promise<void>

Open a pinpoint on the map.

Parameters

pid

number

Pinpoint ID

options?

OpenPinpointOptions

options to open pinpoint

Returns

Promise<void>

a promise that resolves if no exception is raised.

Example

var pid = 1234;
livemap.openPinpoint(pid);

removeEventListener()

removeEventListener(eventName, callback): any

Remove the given listener for a specific event type.

Parameters

eventName

"ready" | "mapUpdate" | "mapClick" | "mapLongClick" | "contentUpdated" | "floorChanged" | "indoorLevelsChanged" | "indoorLevelChanged" | "permissionsDenied" | "actionButtonClick" | "autoplayStart" | "autoplayStop" | "pinpointClick" | "pinpointOpen" | "pinpointClose" | "multipointOpen" | "multipointClose" | "userLogin" | "userLogout" | "inaccurateMagnetometer" | "eventOpen" | "eventClose" | "listOpen" | "listClose" | "livemapMoved" | "mapMoved" | "indoorFeatureClick" | "pageChanged" | "arEnabled" | "arDisabled" | "guidingStarted" | "guidingUpdated" | "guidingStopped" | "deviceAttitudeUpdated" | "userLocationUpdated" | "fullscreenEnter" | "fullscreenExit"

Name of event

callback

CallbackListener

Callback to remove

Returns

any

a promise that resolves if no exception is raised.

Example

var myCallback = function(pinpoint) {
// Do something
};
// Add listener
livemap.addEventListener('contentUpdated', myCallback);
// Remove listener
livemap.removeEventListener('contentUpdated', myCallback);

removeMarker()

removeMarker(id): Promise<void>

Remove marker to the map

Parameters

id

string

Marker id to remove

Returns

Promise<void>

a promise which resolves if no exception is raised.

Examples

const marker = {
coordinates: {
latitude: 43.609138,
longitude: 3.884193
},
img: 'http://1.bp.blogspot.com/_2IU2Nt4rD1k/S7NYdiVpUeI/AAAAAAAABRY/YWJbdCPlllI/s400/Eiffel_Tower.JPG'
};
livemap.addMarker(marker).then(function(marker) {
livemap.removeMarker(marker.id)
});
const marker = {
coordinates: {
latitude: 43.609138,
longitude: 3.884193
},
img: 'http://1.bp.blogspot.com/_2IU2Nt4rD1k/S7NYdiVpUeI/AAAAAAAABRY/YWJbdCPlllI/s400/Eiffel_Tower.JPG'
};
const marker = await livemap.addMarker(marker);
livemap.removeMarker(marker.id);

removePolyline()

removePolyline(id): Promise<void>

Remove a polyline from the map

Parameters

id

string

id of polyline

Returns

Promise<void>

a promise that resolves if no error is raised

Examples

livemap.drawPolyline([{latitude: 43.3, longitude: 3.2}, {latitude: 43.2, longitude: 3.1}], { useNetwork: true }).then(function(polyline) {
// Now that you have the id you can remove it when you want
livemap.removePolyline(polyline.id);
});
const polyline = await livemap.drawPolyline([{latitude: 43.3, longitude: 3.2}, {latitude: 43.2, longitude: 3.1}], { useNetwork: true });
livemap.removePolyline(polyline.id);

setBearing()

setBearing(bearing, options?): Promise<void>

Set the map's bearing.

Parameters

bearing

number

New bearing (in degrees)

options?

Options available

duration?

number

Duration of animation in ms

Returns

Promise<void>

a promise which resolves when the action has been sent to the Livemap.

Examples

var bearing = 90;
livemap.setBearing(bearing);
var bearing = 10;
var options = {
duration: 1000
};
livemap.setBearing(bearing, options);

setCenter()

setCenter(center): Promise<void>

Set the map's geographical center.

Parameters

center

Coordinates

New center

Returns

Promise<void>

a promise that resolves if no exception is raised.

Example

var center = { latitude: 43.609395, longitude: 3.884215 };
livemap.setCenter(center);

setDeviceAttitude()

setDeviceAttitude(attitude): Promise<void>

Set the user attitude.

Parameters

attitude

any

Returns

Promise<void>

a promise that resolves if no exception is raised.


setEvents()

setEvents(events): Promise<void>

Populates the map with given events.

Parameters

events

Event[]

Events to populate the map.

Returns

Promise<void>

a promise which resolves if no exception is raised. The resolved object contains the bounds property that encompasses all the pinpoints of the events given as input. Facilitates the use of the fitBounds method.

Example

const container = document.getElementById('wemap-container');
const options = {
emmid: 7087,
token: 'at5819f0d0844cd5.60578643'
};
const livemap = wemap.v1.createLivemap(container, options);
const pinpoint = {
id: 1,
name: 'Wemap Office',
latitude: 43.609138,
longitude: 3.884193,
description: 'Where magic happens'
};

const events = [{
id: 1,
name: 'First event',
pinpoint: pinpoint,
description: 'The description of my great event',
dates: [
{
start: '2018-09-15T08:00:00.000Z',
end: '2018-09-16T08:00:00.000Z'
}
]
}];
livemap.setEvents(events)
.then(() => {
// now you can open one of the created events
livemap.openEvent(1);
});

setFilters()

setFilters(filters, options?): Promise<void>

Update search filters (dates, tags, text).

Parameters

filters

Filters

Filters to apply to the search *

options?

Object of options *

type?

"add" | "replace"

Object of options *

Returns

Promise<void>

a promise that resolves if no exception is raised.

Example

var filters = {
startDate: '2017-02-01',
endDate: '2017-02-05',
query: 'arts décoratifs',
tags: ['monument-historique', 'musee-de-france']
};
* livemap.setFilters(filters);
*
*

setIndoorFeatureState()

setIndoorFeatureState(id, state): Promise<void>

Set state selected or not of an indoor feature

Parameters

id

number

id of pinpoint

state

IndoorFeatureState

New state

Returns

Promise<void>

a promise that resolves if no exception is raised.

Example

livemap.setIndoorFeatureState(1234, {selected: true});

setIndoorLevel()

setIndoorLevel(level): Promise<void>

Set indoor level

Parameters

level

number

Returns

Promise<void>

a promise which resolves if no error occured

Example

livemap.setIndoorLevel(1);

setPinpoints()

setPinpoints(pinpoints, options?): Promise<void>

Populates the map with given pinpoints.

Parameters

pinpoints

AtLeast<Pinpoint, "name" | "id" | "latitude" | "longitude">[]

Pinpoints to populate the map.

options?

options how to populate the map.

type?

"add" | "replace"

Type of how the map is populated.

Returns

Promise<void>

a promise which resolves if no exception is raised. The resolved object contains the bounds property that encompasses all the points given as input. Facilitates the use of the fitBounds method.

Examples

var container = document.getElementById('wemap-container');
var options = {
emmid: 7087,
token: 'at5819f0d0844cd5.60578643'
};
var livemap = wemap.v1.createLivemap(container, options);
var pinpoints = [
{
id: 1,
name: 'Wemap Office',
latitude: 43.609138,
longitude: 3.884193,
description: 'Where magic happens'
},
{
id: 2,
name: 'Effeil Tower',
latitude: 48.858370,
longitude: 2.294481,
description: 'What is that ?',
media_url: 'http://1.bp.blogspot.com/_2IU2Nt4rD1k/S7NYdiVpUeI/AAAAAAAABRY/YWJbdCPlllI/s400/Eiffel_Tower.JPG',
media_type: 'image'
}
];
livemap.setPinpoints(pinpoints)
.then(function() {
// now you can open one of the created pinpoints
livemap.openPinpoint(2);
});
var container = document.getElementById('wemap-container');
var options = {
emmid: 7087,
token: 'at5819f0d0844cd5.60578643'
};
var livemap = wemap.v1.createLivemap(container, options);
var pinpoint1 = {
id: 1,
name: 'Wemap Office',
latitude: 43.609138,
longitude: 3.884193,
description: 'Where magic happens'
};
var pinpoint2 = {
id: 2,
name: 'Effeil Tower',
latitude: 48.858370,
longitude: 2.294481,
description: 'What is that ?',
media_url: 'http://1.bp.blogspot.com/_2IU2Nt4rD1k/S7NYdiVpUeI/AAAAAAAABRY/YWJbdCPlllI/s400/Eiffel_Tower.JPG',
media_type: 'image'
};
var options = {
type: 'add'
};
livemap.setPinpoints([pinpoint1], options);
livemap.setPinpoints([pinpoint2], options);
// Both pinpoints are on the map as we add pinpoint instead of replacing currents

setSourceLists()

setSourceLists(lists): Promise<void>

Define lists in which the map will source its content in addition of current points of the map

Parameters

lists

number[]

Returns

Promise<void>

a promise that resolves if no exception is raised.

Example

livemap.setSourceLists([1234, 5678]);

setUserAttitude()

setUserAttitude(attitude): Promise<void>

Parameters

attitude

any

Returns

Promise<void>

a promise that resolves if no exception is raised.

Deprecated

Use setDeviceAttitude instead. Set the user attitude.


setUserLocation()

setUserLocation(location): Promise<void>

Set the user’s location.

A marker will be added to show the user’s location on the map. If the map features multiple floors, the marker will only be visible on the corresponding floor.

Parameters

location

UserLocation

Returns

Promise<void>

a promise that resolves if no exception is raised.


setZoom()

setZoom(zoom): Promise<void>

Set the map's zoom level.

Parameters

zoom

number

New zoom

Returns

Promise<void>

a promise which resolves when the action has been sent to the Livemap.

Example

var zoom = 8;
livemap.setZoom(zoom);

signInByToken()

signInByToken(accessToken): Promise<void>

Sign user with token.

Parameters

accessToken

string

access token

Returns

Promise<void>

a promise that resolves if no exception is raised.

Example

// Sign user with token.
livemap.signInByToken(accessToken);

signInWithSSO()

signInWithSSO(token, domain): Promise<void>

Sign user with token from SSO

Parameters

token

string

access token

domain

string

domain to use for SSO

Returns

Promise<void>

a promise that resolves if no exception is raised.

Example

const externalToken = getTokenFromYourSSO();
// Sign user with token from SSO and domain.
livemap.signInWithSSO(externalToken, domain);

signOut()

signOut(): Promise<void>

Sign out the current user

Returns

Promise<void>

a promise that resolves if no exception is raised.

Example

livemap.signOut();

stopNavigation()

stopNavigation(): Promise<void>

Stop the currently running navigation.

Returns

Promise<void>

a promise that resolves if no error occurs.

Example

livemap.stopNavigation();

waitForReady()

waitForReady(): Promise<void>

Simply resolve when the Livemap is ready. Use this function to ensure that the livemap is ready before interacting with.

Returns

Promise<void>

A promise which resolves when the Livemap is ready.

Example

livemap.waitForReady().then(function() {
// You can safely interact with the livemap object
});

Types