-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
85 lines (77 loc) · 3.86 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<title>ArcGIS Application Boilerplate</title>
<meta charset="utf-8">
<!--Define the versions of IE that will be used to render the page. See Microsoft documentation for details. Optional.-->
<meta http-equiv="X-UA-Compatible" content="IE=7, IE=9, IE=10">
<!--Use protocol relative urls that way if the browser is viewing the page via HTTPS the js/css file will be requested using the HTTPS protocol-->
<link rel="stylesheet" href="//js.arcgis.com/3.6/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" type="text/css" href="//js.arcgis.com/3.6/js/esri/css/esri.css">
<!--Load any application specific styles-->
<link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<body class="claro">
<!--The ArcGIS API for JavaScript provides bidirectional support. When viewing the application in an right to left (rtl) language like Hebrew and Arabic the map needs to remain in left-to-right (ltr) mode. Specify this by setting the dir attribute on the div to ltr. -->
<!--<div id="mapDiv" dir="ltr"></div>-->
<div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design:'headline', gutters:false" style="width:100%;height:100%;">
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'right'" style="width:250px;">
<div id="dir"></div>
</div>
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'" id="mapDiv"></div>
</div>
<script type="text/javascript">
var package_path = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/'));
var dojoConfig = {
// 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'
}],
parseOnLoad: true
};
</script>
<script type="text/javascript" src="//js.arcgis.com/3.6/"></script>
<script type="text/javascript">
var myDirections;
require([
"dojo/on",
"application/main",
"application/template",
"application/directions",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dojo/domReady!"
], function(
on,
Main,
Template,
Directions
){
//create the template. This will take care of all the logic required for template applciations
//If you need localization set the supportsLocalization value to true to get the localized strings
//from the javascript/nls/resource files.
//Note that we've included a placeholder nls folder and a resource file with one error string
//to show how to setup the strings file.
var supportsLocalization = true; //defaults to false
var myTemplate = new Template(supportsLocalization);
on(myTemplate, "ready", function(config) {
//The config object contains the following properties: helper services, (optionally)
//i18n, appid, webmap and any custom values defined by the applcation.
//In this example we have one called theme.
console.log(config);
myDirections = Directions(config, "dir");
var myMain = Main(config);
on(myMain, "map_loaded", function(map){
console.log("map_loaded: ", map);
myDirections.setMap(map);
});
});
});
</script>
</body>
</html>