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.
Solved! Go to Solution.
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)
if i drop the esri and use only
urlUtils.addProxyRule({
then the message is :
Uncaught TypeError: urlUtils.addProxyRule is not a function
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)
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.