4

With ESRI's Javascript API - is it possible to make only certain layers go through the proxy? I know this is possible in the Flex API via proxyUrl property of applicable layers.

Right now i have this code in my initialization function - but all map content is now routed through proxy.

esri.config.defaults.io.proxyUrl = "proxy.ashx";
esri.config.defaults.io.alwaysUseProxy = true;

2 Answers 2

6

For future reference, v3.4 of the Javascript API added esri.config.defaults.io.proxyRules, which allows you to use the proxy for some services:

https://developers.arcgis.com/javascript/jsapi/esri.urlutils-amd.html#addproxyrule

2

I can't find anything in the ArcGIS Javascript API that lets you decide which layers go through a proxy. According to this page, you should set alwaysUseProxy to true if you're dealing with secured services and tokens. If you set it to false, the proxy is not used on local services when the request is less than 2000 characters.

1
  • 2
    I think Rakeno is right, you have to use the proxy all or nothing. I guess you are using the proxy to authenticate services? If not and its just for transferring complex geometries it might be worth checking out the coors features from V2.5 onwards. blogs.esri.com/esri/arcgis/2011/09/29/… Nov 27, 2012 at 20:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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