Yes! Libchamplain now has a scale! It was long overdue. In fact, I first started to work on it way before libchamplain 0.2.2 was even released (1.25 year ago). It got impeded by more important features and bug fixes. Two or three months ago Tollef Fog Heen took over the branch and added the magic required maths to compute the scale. I then took over his work (as he was quite busy and I wanted this too) to provide the final result.
Since all the changes are backward compatible, I’ll soon release a libchamplain 0.4.3 with the scale disabled by default (to ensure the same visual behaviour as before upgrade). To display a scale, an application just has to change the show-scale property to TRUE.
#if CHAMPLAIN_CHECK_VERSION (0, 4, 3)
g_object_set (champlain_view, "show-scale", TRUE, NULL);
#endif
The scale also supports other exotic units than the SI/metric ones. It can display miles and feet, if you’re into that. By the way, the scale will automatically switch from kilometres to metres when it makes more sense. That was quite more complex to do with miles and feet as they are not simply a power of 10. Set the scale-unit property to CHAMPLAIN_UNIT_MILES to get miles.
You can limit the width (in pixels) of the scale with the max-scale-width property. If you watch closely, the scale will adjust itself right away when you move the map.