BeNav5RNC API
Android

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"
        ]
    }
}
  • polygonIds List of unique Polygon identifiers given as id in the showPolygon command
    • Send "params": {} with no polygonIds to hide every polygon. The params object itself must be present: a command with no params key is rejected with -32700 parse.error. An empty array matches nothing and returns 19 polygon.not.found.
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"
}