mapbox/wax — pull request #196 by petesaia (2012-05-15 15:14:18+00:00)
Title: Google style zoom-Scale added to zoomer component.

I had to add this to a project I'm currently working on and thought this might be a nice addition.

I've extended the "zoomer" to have an optional Google-style scale. The scale is added if a second parameter is passed to wax.mm.zoomer. Right now in the example given on the site, a jsonp (tilejson) object is passed in as the second parameter but I didn't see how that was utilized so I used that spot to determine whether or not the scale should show. It's lightweight out of the box, but highly customizable. CSS isn't required, but I've added a bit to show it's capabilities to controls.css. I've also contained the zoomin and zoomout buttons in the wax-zoomer container for greater flexibility.

Example:
var zoomer = wax.mm.zoomer(map, true);

See it in action here:
http://petesaia.com/work/wax-zoom/