Files
openlayers/examples/wms-capabilities.js
Frederic Junod 79c8afdba8 Simplify import path in examples
To have the same path (starting with `ol/`, without `.js`) as in the documentation.
The support was added in the webpack config in #8928
2018-11-26 17:18:52 +01:00

11 lines
320 B
JavaScript

import WMSCapabilities from 'ol/format/WMSCapabilities';
const parser = new WMSCapabilities();
fetch('data/ogcsample.xml').then(function(response) {
return response.text();
}).then(function(text) {
const result = parser.read(text);
document.getElementById('log').innerText = JSON.stringify(result, null, 2);
});