Manage user position
All events for manage user position in the map
setUserPosition
Define current user position
Parameters
Name | type | description |
---|---|---|
floor | int | selected floor |
position | Position GPS | user position |
hide | boolean | show or hide the position icon on the map (default value false) |
angle | int | define the rotation angle in degree of the position icon (from 0 to 360) |
is_accurate | boolean | change position icon colour depending on the accuracy |
show_arrow | boolean | show orientation arrow around the icon |
Result
No result
Example
FnoMapManager.sendEvent('setUserPosition', { floor: 0, angle:30, hide:false, is_accurate:true, show_arrow:true, position : {latitude:48.2, longitude: 2.8 }});
focusToUserPosition
Center map on user position
Parameters
No parameter
Result
No result
FnoMapManager.sendEvent('focusToUserPosition', {}});
followUser
Always center map on user position until user clicks on map
Parameters
Name | type | description |
---|---|---|
follow | boolean | activate / disable |
Result
No result
FnoMapManager.sendEvent('followUser', { follow:true});
enableUserOrientation
Activate / disable user orientation
Parameters
Name | type | description |
---|---|---|
enable | boolean | activate / disable |
Result
No result
FnoMapManager.sendEvent('enableUserOrientation', { enable:true});
getUserPosition
Get current user position in the map
Parameters
No parameter
Result
Name | type | description |
---|---|---|
x | decimal | |
y | decimal | |
z | decimal | |
floor | int | current user floor |
scale | decimal |
Example
FnoMapManager.sendEvent('getUserPosition', null, (data) => {
console.log("user position:", data)
});