Add legend blocks
Dynamic legend

Legend is dynamic and updates when index or scale is updated. Code is
dirty and needs cleaning (generalization).
Merge branch 'map-legend' into gh-pages