zoomTo
Command
Centres the map on a point at a given zoom level (2D, north-up)
Send this JSON-RPC message in the
BND_MESSAGE extra of an Intent with the action ACTION_RNC_BROADCAST, to BeNav's activity or receiver: see Sending commands.Moves the map to a chosen position and zoom level. The client application decides what the driver is looking at (a delivery point, a depot entrance, the whole of the next sector) rather than leaving them to pan and pinch while driving.
The view switches to a north-up 2D view centred on the point, and stops following the vehicle. The driver gets the usual recenter control to resume tracking whenever they want.
Worth knowing
- Because the camera stops following the vehicle, this is for a moment of orientation, not a driving view.
Command#
json
{
"jsonrpc": "2.0",
"method": "zoomTo",
"params": {
"lat": 43.6961,
"long": 7.2716,
"zoomLevel": 15.0
},
"id": "1"
}lat/longWGS84 coordinates of the new map centre. Note the key islonghere, notlonas instartGuidancewaypoints.zoomLevelMap zoom level. Accepted from2.5upwards and clamped to the range the map supports (maximum22.5).
Response#
Success#
json
{
"jsonrpc": "2.0",
"result": {},
"id": "1"
}Error#
Generic errors, plus:
-32602 invalid.params- coordinates outside the WGS84 range, or azoomLevelbelow 2.5.-2 application.not.ready- the map is not attached yet.