-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
125 lines (118 loc) · 3.64 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, user-scalable=no">
<title>Advanced Draw</title>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.css" rel="stylesheet">
<style type="text/css">
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
body {
font: 14px sans-serif;
color: #333;
}
#bc {
width: 100%;
height: 100%;
}
#left {
width: 360px;
z-index: 1;
}
#map {
width: 100%;
height: 100%;
z-index: 1;
padding: 0;
overflow: hidden;
}
/* must use important w/ xstyle */
.map .tooltip {
width: 120px;
background-color: rgba(255, 255, 255, 0.75) !important;
border: none !important;
padding: 4px;
text-align: center;
font-size: 12px;
font-weight: bold !important;
}
</style>
</head>
<body class="claro">
<div id="bc"></div>
<script>
dojoConfig = {
async: true,
packages: [{
name: 'src',
location: location.pathname.replace(/[^\/]+$/, '') + 'src'
}]
};
</script>
<script src="//js.arcgis.com/3.10compact/"></script>
<script>
var app = {};
require([
'esri/map',
'esri/layers/GraphicsLayer',
'esri/layers/FeatureLayer',
'src/AdvancedDraw', // the draw widget
'dijit/layout/BorderContainer',
'dijit/layout/ContentPane',
'xstyle/css!dijit/themes/claro/claro.css',
'xstyle/css!esri/css/esri.css',
'dojo/domReady!'
], function (Map, GraphicsLayer, FeatureLayer, AdvancedDraw, BC, CP) {
// layout
var bc = new BC({
gutters: true,
liveSplitters: false
}, 'bc');
bc.startup();
bc.addChild(new CP({
id: 'left',
region: 'left',
content: '<div id="advanced-draw"></div>'
}));
bc.addChild(new CP({
id: 'map',
region: 'center'
}));
// the map
app.map = new Map('map', {
basemap: 'satellite',
zoom: 12,
center: [-123, 45]
});
// test w/ feature layer\
app.map.addLayer(new FeatureLayer('http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0', {
mode: 1,
outFields: ['*']
}));
// test sticky layers
app.map.addLayer(new GraphicsLayer({id: 'temp1'}));
app.map.addLayer(new GraphicsLayer({id: 'temp2'}));
app.map.addLayer(new GraphicsLayer({id: 'temp3'}));
app.addLayer = function () {
app.map.addLayer(new GraphicsLayer({id: 'temp4'}), 0);
app.map.addLayer(new GraphicsLayer({id: 'temp5'}), 0);
app.map.addLayer(new GraphicsLayer({id: 'temp6'}));
};
app.addLayers = function () {
app.map.addLayers([new GraphicsLayer({id: 'temp7'}), new GraphicsLayer({id: 'temp8'}), new GraphicsLayer({id: 'temp9'})]);
};
// the widget
app.advancedDraw = new AdvancedDraw({
map: app.map
}, 'advanced-draw');
app.advancedDraw.startup();
});
</script>
</body>
</html>