addProxyRule

3750
3
Jump to solution
07-21-2015 04:19 AM
roialgavish
New Contributor III

Hello,

i am using this code:

esri.urlUtils.addProxyRule({

                urlPrefix: "***",

                proxyUrl: "***"

                });

And it doesn't work, I get this error in the console:

Uncaught TypeError: Cannot read property 'addProxyRule' of undefined

I added the currect classes to the require part:

require([

        "esri/map", "esri/dijit/Search", "esri/layers/FeatureLayer", "esri/InfoTemplate", "dojo/domReady!","esri/layers/ArcGISDynamicMapServiceLayer", "esri/urlUtils"

      ], function (Map, Search, FeatureLayer, InfoTemplate, ArcGISDynamicMapServiceLayer, urlUtils)

What am I missing?

thank you.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Roi,

    Your order in your requires and vars has to match you currently have domReady! before ArcGISDynamicMapServiceLayer. The domReady! should always be the very last require in your list. Also when using AMD style you only need to use urlUtils.addProxyRule.

require([
"esri/map", "esri/dijit/Search", "esri/layers/FeatureLayer", "esri/InfoTemplate","esri/layers/ArcGISDynamicMapServiceLayer", "esri/urlUtils", "dojo/domReady!"
], function (Map, Search, FeatureLayer, InfoTemplate, ArcGISDynamicMapServiceLayer, urlUtils)

View solution in original post

3 Replies
roialgavish
New Contributor III

if i drop the esri and use only

urlUtils.addProxyRule({

then the message is :

Uncaught TypeError: urlUtils.addProxyRule is not a function

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Roi,

    Your order in your requires and vars has to match you currently have domReady! before ArcGISDynamicMapServiceLayer. The domReady! should always be the very last require in your list. Also when using AMD style you only need to use urlUtils.addProxyRule.

require([
"esri/map", "esri/dijit/Search", "esri/layers/FeatureLayer", "esri/InfoTemplate","esri/layers/ArcGISDynamicMapServiceLayer", "esri/urlUtils", "dojo/domReady!"
], function (Map, Search, FeatureLayer, InfoTemplate, ArcGISDynamicMapServiceLayer, urlUtils)
roialgavish
New Contributor III

Robert,

Thank you i am new at this.

you helped me before with your flex search widget and i really appreciate your help.

it worked.

thanks.

0 Kudos