Add wmts-capabilities example

This commit is contained in:
Frederic Junod
2013-03-12 14:36:29 +01:00
committed by Bruno Binet
parent baa5500843
commit 2eb5454ac4
3 changed files with 578 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
goog.require('ol.parser.ogc.WMTSCapabilities');
var parser = new ol.parser.ogc.WMTSCapabilities(), result;
var url = 'data/WMTSCapabilities.xml';
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
/**
* onload handler for the XHR request.
*/
xhr.onload = function() {
if (xhr.status == 200) {
result = parser.read(xhr.responseXML);
document.getElementById('log').innerHTML =
window.JSON.stringify(result, undefined, 2);
}
};
xhr.send();