Solved! Go to Solution.
Has anyone been successful in getting the legend to work when using the proxy? Or has this been fixed in the latest version of the API? 2.7?
dojo.connect(map, 'onExtentChange', onZoomEnd);
function onZoomEnd() {
if (navigator.appName == 'Microsoft Internet Explorer') {
timer = setTimeout(function () {
var imgs = dojo.query('.esrilegendLayer > tbody > tr > td > img');
for (var i = 0; i < imgs.length; i++) {
imgs.src = "http://server/proxy.ashx?" + imgs.src;
}
}, 100);
}
}I used that workaround code, but had to change the ".esrilegendLayer" to ".esriLegendLayer" and then the swatches showed up for me. Also used instead:
map.on("extent-change", onZoomEnd);