Skip to content

Commit

Permalink
add addProxyRule to viewer.js
Browse files Browse the repository at this point in the history
  • Loading branch information
btfou committed Sep 8, 2015
1 parent 5734d5c commit 9500fa8
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions viewer/js/config/viewer.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
define([
'esri/units',
'esri/geometry/Extent',
'esri/config',
'esri/tasks/GeometryService',
'esri/layers/ImageParameters'
], function (units, Extent, esriConfig, GeometryService, ImageParameters) {
'esri/units',
'esri/geometry/Extent',
'esri/config',
/*'esri/urlUtils',*/
'esri/tasks/GeometryService',
'esri/layers/ImageParameters'
], function (units, Extent, esriConfig, /*urlUtils,*/ GeometryService, ImageParameters) {

// url to your proxy page, must be on same machine hosting you app. See proxy folder for readme.
esriConfig.defaults.io.proxyUrl = 'proxy/proxy.ashx';
esriConfig.defaults.io.alwaysUseProxy = false;

// add a proxy rule to force specific domain requests through proxy
// be sure the domain is added in proxy.config
/*urlUtils.addProxyRule({
urlPrefix: 'www.example.com',
proxyUrl: 'proxy/proxy.ashx'
});*/

// url to your geometry server.
esriConfig.defaults.geometryService = new GeometryService('http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer');

Expand Down Expand Up @@ -80,7 +89,7 @@ define([
title: 'My layer'
}
}
}, {
}, {
type: 'feature',
url: 'http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0',
title: 'San Francisco 311 Incidents',
Expand All @@ -91,7 +100,7 @@ define([
outFields: ['req_type', 'req_date', 'req_time', 'address', 'district'],
mode: 0
}
}, {
}, {
type: 'dynamic',
url: 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyOperationalLayers/MapServer',
title: 'Louisville Public Safety',
Expand All @@ -109,7 +118,7 @@ define([
hideLayers: [21]
}
}
}, {
}, {
type: 'dynamic',
url: 'http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/MapServer',
title: 'Damage Assessment',
Expand All @@ -127,7 +136,7 @@ define([
metadataUrl: true,
expanded: true
}
}],
}],
// set include:true to load. For titlePane type set position the the desired order in the sidebar
widgets: {
growler: {
Expand Down

0 comments on commit 9500fa8

Please sign in to comment.