Solved! Go to Solution.
what is the lowest version of the API that the new proxy will work on? I have some code stuck at 3.0, which onlyu seems to pass the initial requests in - query tasks go direct to server.
OK - I've had some spare time and found the issue.
I use this code
//return the layer descriptions and © text into arrays - we use this later for the info dialog to generate hyperlinks and © text
dojo.forEach(dynamicMapServiceLayer.layerInfos, function (layer) {
var restAPIServicePage = {
url: mapservice2 + "/" + layer.id +
"?f=json&token=uO3JarsebollockswxI9ExjTj_VE5IgAHr9YKPjoE3Mn00qipj9Baxjg1s0lm1c4c", callbackParamName: "callback", load: function (data) {
LayerDescriptions[layer.id] = data.description;
dynamicMapServiceLayer.layerInfos[layer.id].copyrightText = data.copyrightText;
}
};
dojo.io.script.get(restAPIServicePage);
});
in my init function, to step throughmy layers and return the description into an array, which I use for layer specific hyperlinks in my ID task results.
As you see, I've had to hard code a token here as it appears to be this bit that doesn't go via the proxy, so fails to return anything
Is this the only realistic way of doing it?
Cheers
ACM
Ah - answered my last question myself - I needed to wrap it in a esri.request.
var requestHandle = esri.request({
url:mapservice2 + "/" + layer.id + "?f=json",
handleAs: "json",
load: function (data) {
console.debug(data)
LayerDescriptions[layer.id] = data.description;
dynamicMapServiceLayer.layerInfos[layer.id].copyrightText = data.copyrightText;
},
}, { useProxy: true });
I don't mean to revive what appears to be a solved problem, but I am experiencing perhaps a similar issue.
I was wondering if you had experienced any similar behavior when you had your issue?
Thanks,
Alex