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;
asked Nov 27, 2012 at 16:19

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

answered Jun 5, 2013 at 6:03
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.

answered Nov 27, 2012 at 16:36
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/… Commented Nov 27, 2012 at 20:57

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.