Compass is a perk Bedrock ranks get on Survival Games. It lets you see the nearest player's location by pointing the compass towards the player. It had a bug before which allowed Lapis rank to use it too but the bug was fixed.
With the Survival Games update of 29th May 2017, the compass was changed from pointing to the nearest player to point to all players. You can toggle who the compass is pointing to by clicking it. It will show the name of the player and the distance.