Simplify example and let it use real resolutions.

Thanks to @twpayne for the suggestion.
Use OSM resolutions as fallback resolutions.

Hat tip to @twpayne for suggesting this change in the defaults.
Add an assertion to the dragchange handler.

This ensures that the result of resolution calculation stays inside of the
allowed bounds.
Unregister previous map event listeners, if any.

Thanks for spotting this, @twpayne.
More specific argument type of callback method.