0

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.

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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