hidePolygon
Command
Remove specific Polygon(s) from MapView, destroy their associated PolygonStyle if not in use anymore
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.Removes areas from the map by id, leaving the others in place, for a zone that no longer applies, without redrawing the rest.
Worth knowing
- Omit the id list entirely to clear every polygon. An empty list matches nothing
and returns
19 polygon.not.found.
Command#
json
{
"id": "Hide_Selected_Polygon",
"jsonrpc": "2.0",
"method": "hidePolygon",
"params" : {
"polygonIds" : [
"Polygon A - Red Border Blue Fill",
"Polygon B - Green Border Yellow Fill Thick"
]
}
}polygonIdsList of unique Polygon identifiers given asidin theshowPolygoncommand- Send
"params": {}with nopolygonIdsto hide every polygon. Theparamsobject itself must be present: a command with noparamskey is rejected with-32700 parse.error. An empty array matches nothing and returns19 polygon.not.found.
- Send
json
{
"id": "Hide_All_Polygons",
"jsonrpc": "2.0",
"method": "hidePolygon",
"params": {}
}Response#
Success#
Generic responses
Error#
if not a single id is found
json
{
"error": {
"code": 19,
"message": "polygon.not.found"
},
"id": "test_hide",
"jsonrpc": "2.0"
}