openlayers/ol3 — pull request #342 by bbinet (2013-03-11 10:18:17+00:00)
Title: Add WMTS support.

This pull request add support for WMTS in ol3 and provide both ``ol.source.WMTS`` and ``ol.tilegrid.WMTS`` classes.

There is still some TODO/FIXME in the code that need to be answered or implemented, but some could be done in other pull requests.

This PR also bring a ``ol.source.WMTS.createFromCapabilities`` factory which will create a WMTS source from a WMTS capabilities object (returned by the WMTS parser).
But I think this should be refactored into a ``ol.source.WMTS.optionsFromCapabilities`` function that would return a ``ol.source.WMTSOptions`` instead. With this implemented, the ``ol.source.WMTS`` constructor could fetch missing required options directly by querying a getCapabilities by itself.
I propose to implement this in a separate pull request if you agree with this approach.

In this ``ol.source.WMTS.createFromCapabilities`` function I also had to typecast every property coming from the wmts getcapabilities object returned by the wmts parser, because this object is not typed and unknown from the closure compiler.
So it would be great if our formats could provide typed objects so that closure compiler could typecheck these objects and apply advanced optimisation on these objects too.