Manage temporary waypoint
Temporary waypoint are pins inserted in the current map session but are not saved in server. If you restart the map, all previous temporary waypoints will be removed.
insertTemporaryWaypoint
Create and show a new waypoint on the map
Parameters
Name | type | description |
---|---|---|
position | Position GPS | Position of the waypoint |
label | string | Label to show |
url_icon | string | Url of the image to show. Don't activate this option if you use the key "base64". |
base64 | string | Base64 of the image. Don't activate this option if you use the key "url_icon". |
floor | int | floor where waypoint will be inserted |
Result
Example
FnoMapManager.sendEvent('insertTemporaryWaypoint', {
position: {latitude:"48.2", longitude: "2.8" },
label: "my POI",
url_icon: "https://example.fr/my-image.png",
floor: 5
}, (data) => {
console.log("waypoint created:", data);
});
removeTemporaryWaypoint
Delete a temporary waypoint
Parameters
Name | type | description |
---|---|---|
id | int | Id of the temporary waypoint to delete |
Result
No result
Example
FnoMapManager.sendEvent('removeTemporaryWaypoint', {id: 12345});
moveTemporaryWaypoint
Move a waypoint position
Parameters
Name | type | description |
---|---|---|
id | int | id of the temporary waypoint to move |
position | Position GPS | New coordinates of the waypoint |
floor | int | Id floor of the GPS position |
Result
No result
Example
FnoMapManager.sendEvent('moveTemporaryWaypoint', {id: 123,floor:2, position: {latitude: 0.0, longitude: 0.0}});
getAllTemporaryWaypoints
Get all temporary waypoints
Parameters
No parameter
Result
Name | type | description |
---|---|---|
waypoints | Temporary waypoint[] | All waypoints |
Example
FnoMapManager.sendEvent('getAllTemporaryWaypoints', null, (data) => {
console.log("Temporary waypoints:", data.waypoints)
});
toggleTemporaryWaypoints
Show or hide all temporay waypoints
Parameters
Name | type | description |
---|---|---|
state | boolean | true or false |
Result
No result
Example
FnoMapManager.sendEvent('toggleTemporaryWaypoints', {state: true});