/
App.js
100 lines (82 loc) · 2.85 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
define([
'dijit/registry',
'dojo/dom',
'dojo/_base/declare',
'dijit/_WidgetBase',
'dijit/_TemplatedMixin',
'dijit/_WidgetsInTemplateMixin',
'dojo/text!app/templates/App.html',
'agrc/widgets/map/BaseMap',
'ijit/modules/ErrorLogger',
'ijit/widgets/layout/SideBarToggler',
'ijit/widgets/layout/PaneStack',
'dijit/layout/BorderContainer',
'dijit/layout/ContentPane'
],
function (
registry,
dom,
declare,
_WidgetBase,
_TemplatedMixin,
_WidgetsInTemplateMixin,
template,
BaseMap,
ErrorLogger,
SideBarToggler,
PaneStack
) {
return declare("app/App",
[_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin],
{
// summary:
// The main widget for the app
widgetsInTemplate: true,
templateString: template,
baseClass: 'app',
// map: agrc.widgets.map.Basemap
map: null,
constructor: function(){
// summary:
// first function to fire after page loads
console.info(this.declaredClass + "::" + arguments.callee.nom, arguments);
// esri.config.defaults.io.corsEnabledServers.push("dagrc.utah.gov");
AGRC.errorLogger = new ErrorLogger({appName: 'ProjectName'});
AGRC.app = this;
this.inherited(arguments);
},
postCreate: function () {
// summary:
// Fires when
console.log(this.declaredClass + "::" + arguments.callee.nom, arguments);
// set version number
this.version.innerHTML = AGRC.version;
this.inherited(arguments);
},
startup: function () {
// summary:
// Fires after postCreate when all of the child widgets are finished laying out.
console.log(this.declaredClass + "::" + arguments.callee.nom, arguments);
// call this before creating the map to make sure that the map container is
// the correct size
this.inherited(arguments);
var ps;
var sb;
ps = new PaneStack(null, this.paneStack);
this.initMap();
sb = new SideBarToggler({
sidebar: this.sideBar.domNode,
mainContainer: this.mainContainer,
map: this.map,
centerContainer: this.centerContainer.domNode
}, this.sidebarToggle);
this.inherited(arguments);
},
initMap: function(){
// summary:
// Sets up the map
console.info(this.declaredClass + "::" + arguments.callee.nom, arguments);
this.map = new BaseMap(this.mapDiv, {defaultBaseMap: 'Terrain'});
}
});
});