Effect parameter in WMSLayer does not give expected result

398
2
Jump to solution
09-20-2022 04:55 AM
jotwe
by
New Contributor II

Hello,

I am trying to change the appearance of a WMSLayer in ArcGIS API for JS v4.24 by setting the effect parameter. But for some reason, I cannot see any change in the rendered output.

To make sure it's not a problem with my code or WMS service, I used the official WMSLayer example:

https://developers.arcgis.com/javascript/latest/sample-code/layers-wms/

I modified the constructor in the provided CodePen by adding the effect parameter:

 

const layer = new WMSLayer({
  url: "https://ows.terrestris.de/osm/service",
  sublayers: [
    {
      name: "OSM-WMS"
    }
  ],
  effect: "invert(100%)"
});

 

I also tried "blur(5px)", "brightness(50%)" and "hue-rotate(270deg)" but never saw any difference after zooming and panning the map.

Am I missing something here? I could not find any hints in the documentation or other community posts.

0 Kudos
1 Solution

Accepted Solutions
AnneFitz
Esri Regular Contributor

Hi @jotwe - there are two things that might be going on here. 

1. Effects are not supported in 3D SceneViews, that's documented as a known limitation here: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#effect

2. For 2D MapViews, we unfortunately have a bug with effects and WMSLayer at version 4.24. It has already been fixed for the upcoming release (planned for November). In the meantime, you can check out the fix by using the development version of the API at <script src="https://js.arcgis.com/next/"></script>

View solution in original post

2 Replies
AnneFitz
Esri Regular Contributor

Hi @jotwe - there are two things that might be going on here. 

1. Effects are not supported in 3D SceneViews, that's documented as a known limitation here: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#effect

2. For 2D MapViews, we unfortunately have a bug with effects and WMSLayer at version 4.24. It has already been fixed for the upcoming release (planned for November). In the meantime, you can check out the fix by using the development version of the API at <script src="https://js.arcgis.com/next/"></script>

jotwe
by
New Contributor II

Thanks a lot for the quick reply. Then I will wait for the upcoming version...

0 Kudos