How to use WMSmap with proxy?

654
1
03-07-2017 12:35 AM
VictorKniif
New Contributor

So we have an wmsmap that we want to showcase using the arcgis javascript 3.20 api. To do this we have to use a proxy.

How are we supposed to do this in the best way?

Currently the code looks as below.


) {
parser.parse();

esriConfig.defaults.io.proxyUrl = "https://example.proxy.com/pubs/lmproxy/proxy.ashx";
map = new Map("map", {
//basemap: "topo",
"extent":new Extent({xmin:183742,ymin:6721409,xmax:191080,ymax:6729043,spatialReference:{wkid:3010}})

});

var layer1= new WMSLayerInfo({
name: "example",
title: "exampletitle"
});


//ny basemap här
var wmsLayer = new WMSLayer("http://maps.example.com/topowebb/wms/v1", {
format: "jpeg",
layers: "example",
//request: "GetMap",
//epsg: "4326",
//version: "1.3.0",
//visibleLayers: ["1"]
});
map.addLayer(wmsLayer);
var scalebar = new Scalebar({
map: map,

0 Kudos
1 Reply
VictorKniif
New Contributor

Currently we are getting 401 unauthorized from the console. 

0 Kudos