Add wmts-capabilities example
This commit is contained in:
committed by
Bruno Binet
parent
baa5500843
commit
2eb5454ac4
20
examples/wmts-capabilities.js
Normal file
20
examples/wmts-capabilities.js
Normal 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();
|
||||
Reference in New Issue
Block a user