var map, marker, unitID, unitEventID, polyline, mapWaypts = [];
function msg(text) { $("#log").prepend(text + "<br/>"); }
var sess = wialon.core.Session.getInstance();
var flags = wialon.item.Item.dataFlag.base;
sess.loadLibrary("itemIcon");
[{type: "type", data: "avl_unit", flags: flags, mode: 0}],
if (code) { msg(wialon.core.Errors.getErrorText(code)); return; }
var units = sess.getItems("avl_unit");