AnsweredAssumed Answered

Refreshing WMS layers

Question asked by coreyalix01 on Aug 29, 2012
Latest reply on Nov 11, 2014 by alassom
I'm really struggling with figuring out how to refresh a WMS layer.  There seems to be a few missing operations:

  • First, it would be nice if we could simply invoke refresh() to update the imagery.

  • Second, it would be nice if we could clone() a layer and add it to a map.  This would allow us to add a new layer like the one we want to refresh before removing the old layer.

  • Third, without the two options above it would be nice if we could manually override supressing the GetMap request when two layers resolve to the same url.

In the third case I'm adding two layers and only imagery for the first is attempted:

        function createWmsLayer()         {             var layer = new esri.layers.WMSLayer("");             layer.setVisibleLayers([2]);             layer.setImageFormat("png");             return layer;         }          map.addLayer(createWmsLayer());         map.addLayer(createWmsLayer());

http activity:

http://localhost:55240/Proxy.ashx?  http://localhost:55240/Proxy.ashx?,-125.192865,55.5544955813253,-66.105824

It seems the only way to force the imagery to reload is by adding another WMS layer exactly like the first but with a random query string value.  Is there a better way?

Related Post