-
Notifications
You must be signed in to change notification settings - Fork 83
/
viewer.html
161 lines (160 loc) · 5.49 KB
/
viewer.html
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="Keywords"
content="GeoForm, GeoForm Template, Template, Map, Esri"
/>
<meta
name="description"
content="GeoForm is a configurable template for form based data editing of a Feature Service. This application allows users to enter data through a form instead of a map’s pop-up while leveraging the power of the Web Map and editable Feature Services."
/>
<meta name="author" content="esri" />
<!-- Facebook -->
<meta property="og:title" content="GeoForm" />
<meta property="og:image" content="images/item.png" />
<meta property="og:site_name" content="esri" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
/>
<!-- Chrome for Android -->
<link rel="apple-touch-icon" href="images/apple-touch-icon.png" />
<title>GeoForm</title>
<!-- Bootstrap core CSS -->
<!-- Latest compiled and minified CSS -->
<link
rel="stylesheet"
type="text/css"
href="js/vendor/bootstrap/css/bootstrap.min.css"
/>
<link
rel="stylesheet"
type="text/css"
href="https://js.arcgis.com/3.35/esri/css/esri.css"
/>
<link
rel="stylesheet"
type="text/css"
href="https://js.arcgis.com/3.35/dijit/themes/claro/claro.css"
/>
<link
rel="stylesheet"
type="text/css"
href="js/vendor/font-awesome/css/font-awesome.min.css"
/>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link id="rtlCSS" rel="stylesheet" />
<link href="js/vendor/select2/select2.min.css" rel="stylesheet" />
<script src="js/vendor/jquery.min.js"></script>
<script src="js/vendor/moment-with-langs.min.js"></script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="js/vendor/html5shiv.min.js"></script>
<script src="js/vendor/respond.min.js"></script>
<![endif]-->
</head>
<body id="geoform" class="claro app-loading">
<a id="top">
<!-- Top of page -->
</a>
<div class="loading-indicator">
<div class="icon-loading"></div>
<div class="loading-error">
<div class="alert alert-danger">
<span class="icon-frown"></span>
<span id="loading_message"></span>
</div>
</div>
</div>
<script type="text/javascript">
var webgl = location.search.match(/webgl=([\w-]+)/)
? RegExp.$1.toLowerCase() === "false"
? 0
: 1
: 1;
var package_path = window.location.pathname.substring(
0,
window.location.pathname.lastIndexOf("/")
);
var dojoConfig = {
async: true,
has: {
"esri-featurelayer-webgl": webgl,
},
// The locationPath logic below may look confusing but all its doing is
// enabling us to load the api from a CDN and load local modules from the correct location.
packages: [
{
name: "application",
location: package_path + "/js",
},
{
name: "config",
location: package_path + "/config",
},
{
name: "arcgis_templates",
location: package_path + "/..",
},
{
name: "vendor",
location: package_path + "/js/vendor",
},
{
name: "Sanitizer",
location: package_path + "/js/vendor/sanitizer",
main: "arcgis-html-sanitizer.min"
},
{
name: "views",
location: package_path + "/views",
},
],
};
// Have to handle a locale parameter before dojo is loaded
if (location.search.match(/locale=([\w-]+)/)) {
dojoConfig.locale = RegExp.$1;
}
</script>
<link href="css/viewer.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="https://js.arcgis.com/3.35"></script>
<script type="text/javascript">
require([
"config/templateConfig",
"application/template",
"application/viewer",
], function (templateOptions, Template, viewer) {
// start template
var myTemplate = new Template(templateOptions);
// create my main application. Start placing your logic in the main.js file.
var myApp = new viewer();
// create my main application. Start placing your logic in the main.js file.
myTemplate.startup().then(
function (config) {
//The config object contains the following properties: helper services, (optionally)
//i18n, appid, webmap and any custom values defined by the application.
//In this example we have one called theme.
var appResponse = config.appResponse;
if (config.appResponse) {
delete config.appResponse;
}
// lets go!
myApp.startup(config, appResponse);
},
function (error) {
// something went wrong. Let's report it.
if (error && error.error && error.error === "application:origin-other") {
//display short org error
document.location.href = "../shared/origin/index.html?appUrl=" + error.appUrl;
} else {
myApp.reportError(error);
}
}
);
});
</script>
</body>
</html>