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 }});
let position = PositionGPS(latitude: 50.850837826709544, longitude: 4.351650924799158) map.setUserPosition(floor: 0, position: position, hide: false, angle: 0, isAccurate: true, showArrow: true) -- var parameters = [String:Any](); parameters["floor"] = 0 parameters["angle"] = 30 parameters["hide"] = false parameters["is_accurate"] = true parameters["show_arrow"] = true var position = [String:Any]() position["latitude"] = 48.2 position["longitude"] = 2.8 parameters["position"] = position map.sendEvent(eventName: "setUserPosition", data: parameters)
PositionGPS position = new PositionGPS(); position.setLatitude(50.850837826709544); position.setLongitude(4.351650924799158); map.setUserPosition(2, position, false, 0, true, true); -- JSONObject data = new JSONObject(); data.put("floor", 0); data.put("angle", 30); data.put("hide", false); data.put("is_accurate", true); data.put("show_arrow", true); JSONObject position = new JSONObject(); position.put("latitude", 48.2); position.put("longitude", 2.8); data.put("position", position); map.sendEvent("setUserPosition", data, null);

focusToUserPosition

Center map on user position

Parameters

No parameter

Result

No result

FnoMapManager.sendEvent('focusToUserPosition', {}});
map.focusToUserPosition() -- map.sendEvent(eventName: "focusToUserPosition", data: nil)
map.focusToUserPosition(); -- map.sendEvent("focusToUserPosition", null, null);

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});
map.followUser(follow: true) -- var parameters = [String:Any](); parameters["follow"] = true map.sendEvent(eventName: "followUser", data: parameters)
map.followUser(true); -- JSONObject data = new JSONObject(); data.put("follow", true); map.sendEvent("followUser", data, null);

enableUserOrientation

Activate / disable user orientation

Parameters

Name

type

description

enable

boolean

activate / disable

Result

No result

FnoMapManager.sendEvent('enableUserOrientation', { enable:true});
map.enableUserOrientation(enable: true) -- var parameters = [String:Any](); parameters["enable"] = true map.sendEvent(eventName: "enableUserOrientation", data: parameters)
map.enableUserOrientation(true); -- JSONObject data = new JSONObject(); data.put("enable", true); map.sendEvent("enableUserOrientation", data, data);

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) });
map.getUserPosition() -- map.sendEvent(eventName: "getUserPosition", data: nil) // delegate @objc optional func getUserPosition(data: Any?) @objc optional func fnoMap(map: FNOMap, userPosition: UserPosition)
map.getUserPosition(new MapFNO.CallbackUserPosition() { @Override public void onValue(UserPosition userPosition) { } }); -- map.sendEvent("getUserPosition", null, new MapFNO.CallbackJSON() { @Override public void onValue(JSONObject jsonObject) { Log.d("LOG", "getUserPosition : " + jsonObject.toString()); } });