Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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;
share|improve this question
add comment

2 Answers 2

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:

http://developers.arcgis.com/en/javascript/jsapi/namespace_esri.html#addproxyrule

share|improve this answer
add comment

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.

share|improve this answer
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/… –  David Wilton Nov 27 '12 at 20:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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