use fit layout on legend panel see MapStory/mapstory/issues/918