create_messages_layer

The render/create_messages_layer method allows you to create a graphic layer using the coordinates from messages.

Endpoint

Copied!
svc=render/create_messages_layer&params={
  "layerName": "<text>",
  "itemId": <long>,
  "timeFrom": <uint>,
  "timeTo": <uint>,
  "tripDetector": <bool>,
  "trackColor": "<text>",
  "trackWidth": <int>,
  "arrows": <bool>,
  "points": <bool>,
  "pointColor": "<text>",
  "annotations": <bool>,
  "flags": <uint>
}

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:
  • 0: no;
  • 1: yes.
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:
  • 0: no;
  • 1: yes.
points Points at the places where messages were received:
  • 0: no;
  • 1: yes.
pointColor The color of the points.
annotations The annotations for the points:
  • 0: no;
  • 1: yes.
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

Copied!
{
  "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:
  • the limit of 50 message layers (the LAYERS_MAX_COUNT reason);
  • the limit on simultaneous resource-intensive requests (the LIMIT api_concurrent reason).
1004 The limit of messages has been reached.

If you find a mistake in the text, please select it and press Ctrl+Enter.