Map to App
In this section you will find messages you can receive from the map in your app.
Status
Ready Status
When the Map is ready to receive messages, it will send a MAP_READY
message.
- Message Type:
MAP_READY
. - Payload Type: empty object.
{
"type": "MAP_READY",
"message": {}
}
Interactions
Current Mouse Position
When the user moves the mouse over the map, the map will send a CURRENT_POS
message.
- Message Type:
CURRENT_POS
. - Payload Type:
ARMapUIEventCurrentPos
.
{
"type": "CURRENT_POS",
"mapMode": "DEFAULT",
"payload": {
"pos": {
"pixel": [412.80859375, 368.17578125],
"lonLat": [-0.5198055393676759, 47.698415549268844]
}
}
}
pixel
field is the position of the mouse on the map in pixel, relative to the top right corner of the map.
You can see that type is at the first and second level of the message.
The root level is the ARMessageEventInput
type, that can be any string
.
The second level is the ARMapUIEvent
type, that can be any ARMapUIEventType
value for Map to App Messages.
Click
When the user clicks on the map, the map will send a CLICK
message.
- Message Type:
CLICK
. - Payload Type:
ARMapUIEventClick
.
{
"type": "CLICK",
"mapMode": "DEFAULT",
"payload": {
"pos": {
"lonLat": [-0.3383360781214185, 48.575909751021186]
},
"hitFeatures": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-0.345602, 48.597481]
},
"properties": {
"_ar": {
"id": "OPERATION_03",
"type": "POI",
"entityType": "OPERATION",
"displayType": "icon",
"displayOptions": {
"img": "bullet_square_red.png",
"width": 16,
"height": 16
},
"tooltip": {
"title": "OPERATION_03",
"body": "DELIVERY"
},
"capacities": ["SELECT", "DRAG_AND_DROP", "ROLLOVER"]
}
}
}
]
}
}
Drag and Drop
When the user starts to drag a [draggable] entity, it will send a DRAG_END
at the end of it.
- Message Type:
DRAG_END
. - Payload Type:
ARMapUIEventDragEnd
.
Example
{
"type": "DRAG_END",
"payload": {
"draggedFeatures": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-0.561642, 47.462544]
},
"properties": {
"_ar": {
"id": "OPERATION_01",
"type": "POI",
"entityType": "OPERATION",
"displayType": "icon",
"displayOptions": {
"img": "bullet_square_red.png",
"width": 16,
"height": 16
},
"tooltip": {
"title": "OPERATION_01",
"body": "DELIVERY"
},
"capacities": ["SELECT", "DRAG_AND_DROP", "ROLLOVER"]
}
}
}
],
"draggedOnFeatures": [
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[1.697037, 46.816713],
[-1.604869, 48.113197]
]
},
"properties": {
"_ar": {
"id": "b4a7eedd-8b3b-4314-a5c5-fb5a1142fa96--COFISOFT--SINARI--4",
"type": "ITINERARY",
"entityType": "ITINERARY",
"displayType": "wired-itinerary",
"capacities": ["SELECT", "ROLLOVER", "DRAG_AND_DROP"],
"itinerary": {
"routeId": "b4a7eedd-8b3b-4314-a5c5-fb5a1142fa96",
"step": 4,
"start": {
"latitude": 46.816713,
"longitude": 1.697037
},
"end": {
"latitude": 48.113197,
"longitude": -1.604869
}
},
"selectedDisplayOptions": {
"color": [240, 148, 31, 1]
},
"tooltip": {
"title": "b4a7eedd-8b3b-4314-a5c5-fb5a1142fa96",
"body": ""
}
}
}
}
],
"draggedType": "OPERATION",
"pos": {
"lonLat": [-0.024374508101432192, 47.50014435041297],
"pixel": [653.1916855973833, 330.9155010240356]
},
"tags": []
},
"mapMode": "DEFAULT"
}
Selection
When the user end a click or box selection, it will send a SELECT_FEATURES
message.
- Message Type:
SELECT_FEATURES
. - Payload Type:
ARMapUIEventSelectFeatures
.
{
"type": "SELECT_FEATURES",
"payload": {
"selectedFeatures": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-0.561642, 47.462544]
},
"properties": {
"_ar": {
"id": "OPERATION_01",
"type": "POI",
"entityType": "OPERATION",
"displayType": "icon",
"displayOptions": {
"img": "bullet_square_red.png",
"width": 16,
"height": 16
},
"tooltip": {
"title": "OPERATION_01",
"body": "DELIVERY"
},
"capacities": ["SELECT", "DRAG_AND_DROP", "ROLLOVER"]
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [1.697037, 46.816713]
},
"properties": {
"_ar": {
"id": "OPERATION_02",
"type": "POI",
"entityType": "OPERATION",
"displayType": "icon",
"displayOptions": {
"img": "bullet_square_red.png",
"width": 16,
"height": 16
},
"tooltip": {
"title": "OPERATION_02",
"body": "DELIVERY"
},
"capacities": ["SELECT", "DRAG_AND_DROP", "ROLLOVER"]
}
}
}
]
},
"mapMode": "DEFAULT"
}
Current Entities Activation
On a single click on feature with AREntityType
of OPERATION
, ACTIVITY
or ITINERARY
, it will send a CURRENT_FEATURES
message.
- Message Type:
CURRENT_FEATURES
. - Payload Type:
ARMapUIEventCurrentFeature
.
{
"type": "CURRENT_FEATURES",
"payload": {
"ref": {
"id": "b4a7eedd-8b3b-4314-a5c5-fb5a1142fa96---XYRIC---5"
},
"entityType": "ACTIVITY"
},
"mapMode": "SELECT"
}
Message will also be sent upon feature box selection.
The feature with the highest priority, according to the SelectInteraction.getCurrentFeatureByPriority
method, will be sent.