Add legend to context layers
Some bugfixes in protocol
Merge branch 'feature/legend' into develop