create_messages_layer

The create_messages_layer function is used to create a graphic layer using the coordinates from messages.

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

NameDescription
layerNameLayer name.
itemIdThe ID of the unit, the messages of which should be requested.
timeFromThe beginning of the interval.
timeToThe end of the interval.
tripDetector

The trip detection usage:

  • 0 — no;
  • 1 — yes.
trackColorThe colour of the track in the ARGB format (A is the alpha channel or the transparency level) or "trip" for colouring tracks by trips ("tripDetector":1 is required). 
trackWidthTrack 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.
pointColorThe colour of the points.
annotations

The annotations for the points: 

  • 0 — no;
  • 1 — yes.
flagsThe flags for displaying markers (optional parameter).

The trackColor parameter examples:

ColourNameARGB code

Opaque red."FFFF0000"

Semi-transparent green."7F00FF00"

Strongly-transparent blue."500000FF"

Marker flags:

FlagValue
0x0001Grouping markers.
0x0002Numbering for markers.
0x0004Event markers.
0x0008Fuel filling markers.
0x0010Image markers.
0x0020Parking markers.
0x0040Speeding markers.
0x0080Stop markers.
0x0100Fuel drain markers.
0x0800Video markers.

Returned result

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 (metres) */
			"max_speed":<unit>		/* 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 (metres) */ 
			"max_speed":<unit> /* maximum speed for interval */
			"color":"<text>" /* interval colour in '#RRGGBB' format */ 
		}
	]
}

See also avl_render.

Possible error codes:

CodeDescription
1004The limit of messages has been reached.
1003The limit of layers has been reached.
1001

No messages to process.

7Failed to fetch the resource with the desired ACL (ADF_ACL_ITEM_EXECUTE_REPORTS).
6Undefined error.
4Wrong input parameters.
Download PDF file
Download Word document

See also