layer = new esri.layers.WMSLayer(lay.url); layer.setVisibleLayers([lay.catalog]); layer.setImageFormat("png"); layer.spatialReference = new esri.SpatialReference({wkid:102100}); layer.layerInfos= new esri.layers.WMSLayerInfo({name:lay.label,title:lay.label}); layer.version= "1.1.1"; layer.id= lay.id;
using api 3.2 layer = new esri.layers.WMSLayer(lay.url); layer.setVisibleLayers([lay.catalog]); layer.setImageFormat("png"); layer.spatialReference = new esri.SpatialReference({wkid:102100}); layer.layerInfos= new esri.layers.WMSLayerInfo({name:lay.label,title:lay.label}); layer.version= "1.1.1"; layer.id= lay.id; For some reason the request is failing occassionally (inconsistently) because the URL does not include the SRS/CRS (i tried 1.3.0 as well).FAILShttp://www.mymanatee.org/lizardtech/iserv/ows?SERVICE=WMS&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=TRUE&STYLES=&VERSION=1.1.1&LAYERS=1978&WIDTH=1600&HEIGHT=791&BBOX=-9233714.17262806,3140877.1703132535,-9111414.927371942,3201338.8596867467WORKShttp://www.mymanatee.org/lizardtech/iserv/ows?SERVICE=WMS&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=TRUE&STYLES=&VERSION=1.1.1&LAYERS=1978&WIDTH=1600&HEIGHT=791&BBOX=-9233714.17262806,3140877.1703132535,-9111414.927371942,3201338.8596867467&SRS=EPSG:102100all i did was manually add the SRS at the end. But i cannot do this in my code, since its just a navigation event requesting a new tile?
var wmsLayer = new esri.layers.WMSLayer("http://www.mymanatee.org/lizardtech/iserv/ows"); wmsLayer.setVisibleLayers(["1940"]); map.addLayer(wmsLayer);
its a wms layer call
i did the manual layer definition when there where wms errors around 2.8/3.0 . I will try the other way.
var wmsLayer = new esri.layers.WMSLayer("http://www.mymanatee.org/lizardtech/iserv/ows"); dojo.connect(wmsLayer, "onLoad", function (lyr) { dojo.forEach(lyr.layerInfos, function (info) { if (info.name){ map.addLayer(new esri.layers.WMSLayer( lyr.url, { visibleLayers: [info.name], //Providing resourceInfo prevents an unnecessary GetCapabilities request resourceInfo: { extent: lyr.extent, layerInfos: lyr.layerInfos, version:lyr.version } }) ); } }); });
//Providing resourceInfo prevents an unnecessary GetCapabilities request
It is usually connect to one wms, switch to another and it fails.
i copied the failing uri out of firebug so I am sure that was the request being made.
i saw this comment in your code//Providing resourceInfo prevents an unnecessary GetCapabilities requestcan you elaborate?
If resourceInfo is specified a GetCapabilities request is not executed
I unset alot of properties, not only does it seem to help, but it seems to have sped it up?!
would you be willing to share your class?
In particular i am looking to try to make tiled requests of the WMS service.
I have been told express server (lizardtech) supports this if the request is made properly.
thanks again for all the help and guidance!
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.