I am a beginner in working with WMS services. In OpenLayers I retrieved a file (EEZ 200 NM) from GeoServer to which I would like to change the fill color. Is that anyway possible from OpenLayers?

    const source_eez_WMS = new ol.source.TileWMS({
      url: 'https://geo.vliz.be/geoserver/MarineRegions/wms?service=WMS&version=1.3.0&request=GetCapabilities',
      params: {
        'FORMAT': 'image/png', 
         tiled: true,
         STYLES: '',
         LAYERS: 'eez'
      crossOrigin: 'anonymous'
    const layer_eez_WMS = new ol.layer.Tile({
        source: source_eez_WMS,
  • 3
    You'd need to send an updated style, using the the SLD or SLD_BODY parameters to the service. The service would change the style and send back an updated image
    – nmtoken
    Dec 1, 2022 at 13:03
  • 1
    Or you could use the WFS and get the vector data and style it in your client
    – nmtoken
    Dec 1, 2022 at 13:07
  • Thanks for the information. I will study how to use SLD and try to apply it, as WFS is not feasible (the file is way too big) Dec 1, 2022 at 15:15

1 Answer 1


This might be what you are looking for try this

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.