Global events

All events for global operations.

activeLog

If you want to disable logs or if you prefer to increase its verbosity you can use these methods. By default, only errors are shown. If you want to see more logs you can activate one or more of these following parameters.

Name

type

description


all

bool

Set all logs


debug

bool

Set debug's log activation


warning

bool

Set warning's log activation


error

bool

Set error's log activation


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

changeBackgroundColor

Change background color

Parameters

Name

type

description

color

string

The color to use for background (hexadecimal format: #90bdf7)

Result

No result

Example

FnoMapManager.sendEvent('changeBackgroundColor', { color: "#90bdf7" });
let backgroundColor = ColorRGBA(r: 255, g: 0, b: 0, a: 0.5) map.changeBackgroundColor(backgroundColor: backgroundColor) -- var parameters = [String:Any](); var backgroundColor = [String:Any](); backgroundColor["r"] = 200 backgroundColor["g"] = 150 backgroundColor["b"] = 55 backgroundColor["a"] = 0.5 parameters["backgroundColor"] = backgroundColor map.sendEvent(eventName: "changeBackgroundColor", data: parameters)
ColorRGBA colorRGBA = new ColorRGBA(255, 0, 0, 0.5); map.changeBackgroundColor(colorRGBA); -- JSONObject parameters = new JSONObject(); JSONObject backgroundColor = new JSONObject(); backgroundColor.put("r", 200); backgroundColor.put("g", 150); backgroundColor.put("b", 55); backgroundColor.put("a", 0.5); parameters.put("backgroundColor", backgroundColor); map.sendEvent("changeBackgroundColor", parameters, null);

screenshot

Take a screenshot of the map and return the base64

Parameters

No parameter

Result

Name

type

description

screenshot

string

Base 64 of the screenshot

Example

FnoMapManager.sendEvent('screenshot', null, (data) => { console.log("screenshot base 64:", data.screenshot); });
map.screenshot() -- map.sendEvent(eventName: "screenshot", data: nil) // delegate @objc optional func screenshot(data: Any?) @objc optional func fnoMap(map: FNOMap, screenshot: String)
map.screenshot(new MapFNO.CallbackString() { @Override public void onValue(String value) { Log.d("LOG", "Base64 screenshot image : " + value); } }); -- map.sendEvent("screenshot", null, new MapFNO.CallbackJSON() { @Override public void onValue(JSONObject jsonObject) { Log.d("LOG:", "screenshot : " + jsonObject.toString()); } });

destroyMap

Remove current map from device memory. Used for change current map

Parameters

No parameter

Result

No result

Example

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

setMouseListener

Allow unity to trigger an event related with mouse (on click, on hover etc ...)

Parameters

Name

type

description

state

boolean

True for enable and false for disable

Result

No result

Example

FnoMapManager.sendEvent('setMouseListener', {state: true});
map.setMouseListener(state: true) -- var parameters = [String:Any](); parameters["state"] = true map.sendEvent(eventName: "setMouseListener", data: parameters) // FNOMapDelegate method @objc optional func mouseClickContainer(data: Any?) @objc optional func mouseClickOutOfContainer(data: Any?)
map.setMouseListener(true, new MapFNO.CallbackJSON() { @Override public void onValue(JSONObject value) { } }); -- JSONObject data = new JSONObject(); data.put("state", true); map.sendEvent("setMouseListener", data, new MapFNO.CallbackJSON() { @Override public void onValue(JSONObject jsonObject) { Log.d("LOG", "setMouseListener result : " + jsonObject.toString()); } });

enableRealTimeUpdates

Enable real time update when a container changed in the server

Parameters

No parameter

Result

No result

Example

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

enableOutsideMap

Enable the outside map with Google Maps with the possibility to define the size of this background image.

Name

type

description

enable

boolean

True for enable and false for disable

size

integer

Define the size of the background

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