Select to view content in your preferred language

WMS Service not showing in map

1240
2
Jump to solution
05-15-2017 03:52 PM
by Anonymous User
Not applicable

I am trying to load my first WMS Service into an ArcGIS API for JavaScript web app. To start I am testing the 'Florida Mosaic' demo service from LizardTech, browsable here:

http://demo.lizardtech.com/lizardtech/iserv/browse 

This is my code to add the service:

wmsTest : new WMSLayer("http://demo.lizardtech.com/lizardtech/iserv/ows", {                    
    resourceInfo: {                      
        extent: new Extent(-82.908008,26.740052,-81.248255,29.572644, new SpatialReference({ wkid:4326 })), // must be in PCS of service
        getMapURL: "http://demo.lizardtech.com/lizardtech/iserv/ows",
        layerInfos: [
            new WMSLayerInfo({
                name: "Florida_Mosaic"
            })
        ],
        spatialReferences : [4326, 26917],                        
    },
    spatialReferences : [4326, 3857],
    version : "1.1.1",
    visibleLayers : ["Florida_Mosaic"]
})

I can see the HTTP Request sent to the demo site, and that their is an image download:

But when I zoom in to Florida, no imagery is displayed.

Some other posts have discussed the need for the service to be in Web Mercator, but the API documentation doesn't say that's required. Is that my issue? Other thoughts?

Thanks for any help/ideas!

0 Kudos
1 Solution

Accepted Solutions
FC_Basson
MVP Regular Contributor

Hi Sarah

This is how got the layer to load and display:

var resourceInfo = {
 extent: new Extent(-180, -90, 180, 90, {
 wkid: 4326
 }),
 layerInfos: [
  new WMSLayerInfo({
    name: 'Alaska_IFSAR',
    title: 'Alaska_IFSAR'
  }),
  new WMSLayerInfo({
    name: 'Colorado',
    title: 'Colorado'
  }),
  new WMSLayerInfo({
    name: 'Florida_Mosaic',
    title: 'Florida_Mosaic'
  })
 ]
};

wmsLayer = new WMSLayer('http://demo.lizardtech.com/lizardtech/iserv/ows', {
 resourceInfo: resourceInfo,
 visibleLayers: ['Florida_Mosaic'] 
});
 
wmsLayer.version = '1.1.1';
wmsLayer.spatialReferences[0] = 3857;
 
map.addLayer(wmsLayer);

It seems like the "version" parameter does not apply immediately during layer construction, but setting it afterwards solves it.  The version is obviously  important for the bbox parameter format and SRS (CRS for 1.3.0)

View solution in original post

0 Kudos
2 Replies
FC_Basson
MVP Regular Contributor

Hi Sarah

This is how got the layer to load and display:

var resourceInfo = {
 extent: new Extent(-180, -90, 180, 90, {
 wkid: 4326
 }),
 layerInfos: [
  new WMSLayerInfo({
    name: 'Alaska_IFSAR',
    title: 'Alaska_IFSAR'
  }),
  new WMSLayerInfo({
    name: 'Colorado',
    title: 'Colorado'
  }),
  new WMSLayerInfo({
    name: 'Florida_Mosaic',
    title: 'Florida_Mosaic'
  })
 ]
};

wmsLayer = new WMSLayer('http://demo.lizardtech.com/lizardtech/iserv/ows', {
 resourceInfo: resourceInfo,
 visibleLayers: ['Florida_Mosaic'] 
});
 
wmsLayer.version = '1.1.1';
wmsLayer.spatialReferences[0] = 3857;
 
map.addLayer(wmsLayer);

It seems like the "version" parameter does not apply immediately during layer construction, but setting it afterwards solves it.  The version is obviously  important for the bbox parameter format and SRS (CRS for 1.3.0)

0 Kudos
by Anonymous User
Not applicable

Amazing! Thanks!

0 Kudos