1
WMSsource = new ol.layer.Image({
    source: new ol.source.ImageWMS({
        url: 'http://localhost:8080/geoserver/alger_data/wms',
        params: {
            'LAYERS': 'alger_data:hotel'
        },
        serverType: 'geoserver',
        crossOrigin: "Anonymous",
        outputFormat: "application/json",
    })
});

map.addLayer(WMSsource);
  • 2
    Do a GetCapabilities – nmtoken Sep 1 at 7:23
  • Welcome to Geographic Information Systems! Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works. – Ian Turton Sep 1 at 8:06
  • 2
    OpenLayers has a WMS Capabilities parser openlayers.org/en/v3.20.1/examples/wms-capabilities.html Once you have a JSON object you can create a simple JavaScript function to search through it, for example for layers named "Temperature" jsfiddle.net/fx5h124p – Mike Sep 1 at 9:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.