Get item info by coordinates

To get information about any item on a graphic layer by its coordinates, use the request:

http://{host}/avl_hittest?rname=<text>&lat=<double>&lon=<double>&scale=<uint>&
radius=<double>&sdk=<text>

:!: Attention
Before executing that command please create appropriate layer using next commands: Create POI layer, Create geofence layer, Create track layer.

Parameters

Name Description
rname renderer name (see Create image renderer)
lat latitude
lon longitude
scale zoom: 0-17
radius search radius
sdk request is sent through SDK: 0 - no, 1 - yes (for compatibility with old versions), common usage - 1.
Use value of this parameter without quotes, otherwise you'll get ERROR in result.

Response

For messages:

{
	"type":2,		/* result type (2 - message) */
	"msg":{		/* current message */
		...
	},
	"_msg":{		/* previous message */
		...
	},
	"imsg":<uint>,	/* index of current message */
	"unit_id":<long>	/* unit ID */
}

Formats of current and previous messages are described in the chapter Data format: Messages.

For markers:

{
	"type":1,		/* result type (1 - marker) */
	"lat":<double>,		/* latitude */
	"lon":<double>,		/* longitude */
	"header":<text>,	/* marker name */
	"text":<text>,		/* information about the marker: depends on marker type */
	"marker":{}		/* additional information about the marker if exists */
}

For geofences:

{
	"type":3,		/* result type (3 - geofence) */
	"lat":<double>,		/* latitude */
	"lon":<double>,		/* longitude */
	"rname":<text>,		/* renderer name */
	"lname":<text>,		/* layer name */
	"shape":{}		/* information about the geofence, for example name */
}
Follow us on Facebook Gurtam Wialon Twitter Gurtam Wialon info@gurtam.com   |   Copyright © 2002-2024 Gurtam