Skip to content

Commit

Permalink
a little housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
btfou committed Sep 1, 2015
1 parent bcbf37a commit 115ebf1
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 34 deletions.
1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* global module */
module.exports = function(grunt) {

// middleware for grunt.connect
Expand Down
29 changes: 13 additions & 16 deletions viewer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,6 @@
</div>
</div>
</div>
<script type="text/javascript">
var dojoConfig = {
async: true,
packages: [{
name: 'viewer',
location: location.pathname.replace(/[^\/]+$/, '') + 'js/viewer'
},{
name: 'config',
location: location.pathname.replace(/[^\/]+$/, '') + 'js/config'
},{
name: 'gis',
location: location.pathname.replace(/[^\/]+$/, '') + 'js/gis'
}]
};
</script>
<!--[if lt IE 9]>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/es5-shim/4.0.3/es5-shim.min.js"></script>
<![endif]-->
Expand All @@ -62,7 +47,19 @@
file = 'config/' + file;
}
}
require(['viewer/Controller', file], function(Controller, config){
require({
async: true,
packages: [{
name: 'viewer',
location: location.pathname.replace(/[^\/]+$/, '') + 'js/viewer'
},{
name: 'config',
location: location.pathname.replace(/[^\/]+$/, '') + 'js/config'
},{
name: 'gis',
location: location.pathname.replace(/[^\/]+$/, '') + 'js/gis'
}]
}, ['viewer/Controller', file], function(Controller, config){
Controller.startup(config);
});
</script>
Expand Down
47 changes: 29 additions & 18 deletions viewer/js/config/viewer.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
define([
'esri/units',
'esri/geometry/Extent',
'esri/config',
'esri/tasks/GeometryService',
'esri/layers/ImageParameters'
], function (units, Extent, esriConfig, GeometryService, ImageParameters) {
'dojo/_base/lang',
'esri/units',
'esri/geometry/Extent',
'esri/config',
/*'esri/urlUtils',*/
'esri/tasks/GeometryService',
'esri/layers/ImageParameters'
], function (lang, units, Extent, esriConfig, /*urlUtils,*/ GeometryService, ImageParameters) {

// url to your proxy page, must be on same machine hosting you app. See proxy folder for readme.
// esri config
esriConfig.defaults.geometryService = new GeometryService('https://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer');
esriConfig.defaults.io.proxyUrl = 'proxy/proxy.ashx';
esriConfig.defaults.io.alwaysUseProxy = false;
// url to your geometry server.
esriConfig.defaults.geometryService = new GeometryService('http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer');
// esriConfig.defaults.io.corsDetection = false;
// urlUtils.addProxyRule({
// urlPrefix: 'geocode.arcgis.com',
// proxyUrl: 'proxy/proxy.ashx'
// });

//image parameters for dynamic services, set to png32 for higher quality exports.
var imageParameters = new ImageParameters();
imageParameters.format = 'png32';
// additional functions, defines, etc you may need in config go here
function ipMix(params) {
return lang.mixin(new ImageParameters(), params);
}

var imageParams = ipMix({
format: 'png32'
});

return {
// used for debugging your app
Expand Down Expand Up @@ -80,7 +91,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,15 +102,15 @@ 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',
options: {
id: 'louisvillePubSafety',
opacity: 1.0,
visible: true,
imageParameters: imageParameters
imageParameters: imageParams
},
identifyLayerInfos: {
layerIds: [2, 4, 5, 8, 12, 21]
Expand All @@ -109,15 +120,15 @@ define([
hideLayers: [21]
}
}
}, {
}, {
type: 'dynamic',
url: 'http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/MapServer',
title: 'Damage Assessment',
options: {
id: 'DamageAssessment',
opacity: 1.0,
visible: true,
imageParameters: imageParameters
imageParameters: imageParams
},
legendLayerInfos: {
exclude: true
Expand All @@ -127,7 +138,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

1 comment on commit 115ebf1

@btfou
Copy link
Contributor Author

@btfou btfou commented on 115ebf1 Sep 1, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intended to PR.

Please sign in to comment.