Add ol.format.WMSCapabilities

This commit is contained in:
Frederic Junod
2014-02-05 14:22:35 +01:00
parent d7d2b3353d
commit 1c13d6ed69
6 changed files with 969 additions and 63 deletions

View File

@@ -1,20 +1,8 @@
goog.require('ol.parser.ogc.WMSCapabilities');
goog.require('ol.format.WMSCapabilities');
var parser = new ol.parser.ogc.WMSCapabilities(), result;
var url = 'data/ogcsample.xml';
var parser = new ol.format.WMSCapabilities();
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();
$.ajax('data/ogcsample.xml').then(function(response) {
var result = parser.read(response);
$('#log').html(window.JSON.stringify(result, null, 2));
});