WMS stuck on SRS=EPSG:102100

2486
6
12-11-2012 08:31 AM
WalterEralio
New Contributor III
I'm creating now access to this WMS server I had working before on 2.1 ... moving to jsapi 3.2 it get stuck on that projection (that is actually not supported by the WMS)

I read it takes the SRS from previous layers or the default.. any hint on how to change it??

I'm setting the layer now with:

// set up the OGC layer    
var layer1 = new esri.layers.WMSLayerInfo({name:'DigitalGlobe:Imagery',version:'1.1.1',title:'DGCS'});    
var resourceInfo = {    
    extent:initialExtent,    
    layerInfos:[layer1]    
};    

var wmsLayer = new esri.layers.WMSLayer(wmsURL, {resourceInfo: resourceInfo, visibleLayers: ['DigitalGlobe:Imagery']});    
wmsLayer.setImageFormat('png');    
wmsLayer.setImageTransparency(true);    
// the layer1 object instantion is broken, without this it defaults to 1.3.0    
wmsLayer.version = '1.1.1';    
        legendLayers.push({layer:wmsLayer,title:'Imagery'});    
wmsLayer.hide();        
 
and InitialExtent is on:
   var initialExtent = new esri.geometry.Extent({    
      'xmin': -9382860.162660452,    
      'ymin': 4998573.770502064,    
      'xmax': -9377829.6507363,    
      'ymax': 5001683.8020905,    
      'spatialReference': {'wkid': 3857}    
   });


Thanks

Walter
0 Kudos
6 Replies
JeffPace
MVP Alum
some words of caution

1.1.1 uses CRS
1.3.0 uses SRS

have you tried

wmsLayer.SpatialReference = new esri.SpatialReference({wkid:3857});
or whatever you want it to be?

btw 3857 and 102100 are the same thing
0 Kudos
WalterEralio
New Contributor III
some words of caution

1.1.1 uses CRS
1.3.0 uses SRS

have you tried

wmsLayer.SpatialReference = new esri.SpatialReference({wkid:3857});
or whatever you want it to be?

btw 3857 and 102100 are the same thing


Thx for your answer...
I did try it before but I double check and it's not working
Regarding SRS I think is the other way around right? (SRS for 1.1.1 and CRS for 1.3.0)

the call generated is something like this:
https://services.digitalglobe.com/mapservice/wmsaccess?CONNECTID=xxx&SERVICE=WMS&REQUEST=GetMap&FORM...

(changing to 1.3.0 call is the same but CRS)
https://services.digitalglobe.com/mapservice/wmsaccess?CONNECTID=xxx&SERVICE=WMS&REQUEST=GetMap&FORM...


and I got back a 403 (FORBIDDEN) .. if I replace both 102100 with 3857 I got back the image...
0 Kudos
JeffPace
MVP Alum
Thx for your answer...
I did try it before but I double check and it's not working
Regarding SRS I think is the other way around right? (SRS for 1.1.1 and CRS for 1.3.0)

the call generated is something like this:
https://services.digitalglobe.com/mapservice/wmsaccess?CONNECTID=xxx&SERVICE=WMS&REQUEST=GetMap&FORM...

(changing to 1.3.0 call is the same but CRS)
https://services.digitalglobe.com/mapservice/wmsaccess?CONNECTID=xxx&SERVICE=WMS&REQUEST=GetMap&FORM...


and I got back a 403 (FORBIDDEN) .. if I replace both 102100 with 3857 I got back the image...


I use expressserver from lizardtech, maybe its different.

I know support for 102100 did not exist out of the box, i needed to manually configure the server to handle it.  Maybe digitalglobe needs to do the same?
0 Kudos
WalterEralio
New Contributor III
I use expressserver from lizardtech, maybe its different.

I know support for 102100 did not exist out of the box, i needed to manually configure the server to handle it.  Maybe digitalglobe needs to do the same?


using another provider is not an option for now.. and DG is not providing 102100 but all the others... question is WHY I CANNOT SET UP THE DEFAULT PROJECTION TO WHATEVER I LIKE?? has to be a way (using version 2.1 with almost the same code sends a SRS=EPSG:4326

            <Title>DigitalGlobe Web Map Service</Title>
            <Abstract></Abstract>
            <SRS>EPSG:3395</SRS>
            <SRS>EPSG:3857</SRS>
            <SRS>AUTO:42004</SRS>
            <SRS>EPSG:4326</SRS>

CHANGING FROM

<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.1:mad:" type="text/javascript">

to

<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.2" type="text/javascript">

CHANGES THE PROJECTION... with 2.1 is WORKING... with 3.2 NO
0 Kudos
JeffPace
MVP Alum
I understand your frustration.  As far as I can tell, DG is rejecting requests at 102100 (the forbidden error) since it isnt a supported reference system, i.e. DG doesn't know how to return an image in 102100, at least not the way the js api is requesting it.

I see a couple options

1. Call DG and try to add 102100.  its the same as 3857 anyway. 
2. Switch your app to 3857. or at least your WMS service.  Its the same anyway.
3. Intercept the request in your proxy and replace the 102100 with 3857 to spoof DG.
4. Write a custom WMS class. 

I did option 4 to make tiled WMS requests.  Its not bad at all.  and you can customized the URL all you want.
0 Kudos
FC_Basson
MVP Regular Contributor

Same issue still in version 3.20, but from this StackOverflow post it can be changed before adding the WMS layer to the map.

wmsLayer.spatialReferences[0] = 3857;
map.addLayers([wmsLayer]);

 

0 Kudos