create_messages_layer
The render/create_messages_layer method allows you to create a graphic layer using the coordinates from messages.
Endpoint
svc=render/create_messages_layer¶ms={
"layerName": "<text>",
"itemId": <long>,
"timeFrom": <uint>,
"timeTo": <uint>,
"tripDetector": <bool>,
"trackColor": "<text>",
"trackWidth": <int>,
"arrows": <bool>,
"points": <bool>,
"pointColor": "<text>",
"annotations": <bool>,
"flags": <uint>
}
The method is a resource-intensive request, so the limit on simultaneous resource-intensive requests during one session applies to it. If the limit is reached, the error 1003 with the
LIMIT api_concurrentreason is returned. For the list of resource-intensive requests, see Limitations.
Parameters
| Parameter | Description |
|---|---|
layerName |
Layer name. |
itemId |
The ID of the unit, the messages of which should be requested. |
timeFrom |
The beginning of the interval. |
timeTo |
The end of the interval. |
tripDetector |
The trip detection usage:
|
trackColor |
The color of the track in the ARGB format (A is the alpha channel or the transparency level) or "trip" for coloring tracks by trips ("tripDetector":1 is required). |
trackWidth |
Track width in pixels. |
arrows |
The arrows of movement direction:
|
points |
Points at the places where messages were received:
|
pointColor |
The color of the points. |
annotations |
The annotations for the points:
|
flags |
The flags for displaying markers (optional parameter). |
The trackColor parameter examples:
| Color | Name | ARGB code |
|---|---|---|
![]() |
Opaque red. | “FFFF0000” |
![]() |
Semi-transparent green. | “7F00FF00” |
![]() |
Strongly-transparent blue. | “500000FF” |
Marker flags:
| Flag | Value |
|---|---|
0x0001 |
Grouping markers. |
0x0002 |
Numbering for markers. |
0x0004 |
Event markers. |
0x0008 |
Fuel filling markers. |
0x0010 |
Image markers. |
0x0020 |
Parking markers. |
0x0040 |
Speeding markers. |
0x0080 |
Stop markers. |
0x0100 |
Fuel drain markers. |
0x0800 |
Video markers. |
Response
{
"name": "<text>", /* layer name */
"bounds": [ /* layer bounds */
<double>, /* minimum latitude */
<double>, /* minimum longitude */
<double>, /* maximum latitude */
<double> /* maximum longitude */
],
"units": [ /* array of units */
{
"id": <long>, /* unit ID */
"msgs": { /* information about messages */
"count": <uint>, /* messages count */
"first": { /* first message */
"time": <uint>, /* time */
"lat": <double>, /* latitude */
"lon": <double> /* longitude */
},
"last": { /* last message */
"time": <uint>, /* time */
"lat": <double>, /* latitude */
"lon": <double> /* longitude */
}
},
"mileage": <double>, /* mileage for interval (meters) */
"max_speed": <uint> /* maximum speed for interval */
}
],
"trips": [ /* only if tripDetector is 1 */
{
"first": { /* first message */
"time": <uint>, /* time */
"lat": <double>, /* latitude */
"lon": <double> /* longitude */
},
"last": { /* last message */
"time": <uint>, /* time */
"lat": <double>, /* latitude */
"lon": <double> /* longitude */
},
"mileage": <double>, /* mileage for interval (meters) */
"max_speed": <uint>, /* maximum speed for interval */
"color": "<text>" /* interval colour in '#RRGGBB' format */
}
]
}
See also avl_render.
If the request fails, an error code is returned.
Error codes
| Error code | Description |
|---|---|
| 4 | Wrong input parameters. |
| 6 | Undefined error. |
| 7 | The unit doesn’t exist, or the user doesn’t have the Request reports and messages access right to it. |
| 1001 | No messages to process. |
| 1003 | One of the following limits is reached:
|
| 1004 | The limit of messages has been reached. |


