Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to place WMSlayer on top of basemap "streets", but have ran into problems. Code:

// mapHandler.mapextent = new esri.geometry.Extent(350000,6370000,750000,6630000,new esri.SpatialReference({"wkid":3301}));

mapHandler.map = new esri.Map('map', {
// extent: mapHandler.mapextent,
center: [25.88270117, 58.70311058],
basemap: 'streets',
spatialReference: new esri.SpatialReference(4326),
zoom: mapHandler.defaultZoom
});
mapHandler.wms1layer1info = new esri.layers.WMSLayerInfo({title:"Maa-ameti fotokaart"});
mapHandler.wms1resourceinfo = {extent: new esri.geometry.Extent(300000,6300000,800000,6700000,{wkid:3301}),layerInfos:[mapHandler.wms1layer1info],version:["1.1.1"]};
mapHandler.wms1layer1 = new esri.layers.WMSLayer("http://kaart.maaamet.ee/wms/fotokaart?",{resourceInfo:mapHandler.wms1resourceinfo,visibleLayers:["MA-FOTOKAART"]});
mapHandler.wms1layer1.setImageFormat("jpg");
// mapHandler.wms1layer1.setVisibleLayers(["0", "1", "2"]);
mapHandler.wms1layer1.setImageTransparency(false);
mapHandler.map.addLayers([mapHandler.wms1layer1]);

With the above code only the basemap is displaying. I'm getting the following warning in console:

Resource interpreted as Image but transferred with MIME type application/vnd.ogc.se_xml: "http://kaart.maaamet.ee/wms/fotokaart?SERVICE=WMS&REQUEST=GetMap&FORMAT=ima…=2445863.801486572,7992358.782554072,3272606.6994188153,8240626.2504242575". 

If I comment out:

basemap: 'streets',

Will result in WMSlayer displaying correctly and also prints the following the console:

Map: Geometry (wkid: 4326) cannot be converted to spatial reference of the map (wkid: 3301) 

Any help would be appreciated.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

If you set basemap 'street' in Map parameters, the Map spatialreference will be fixed to WebMercator(10200). So, your wms service must get map images as WebMercator instead of 3011. But, I guess your wms service not supports projecting map images.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.