-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathissimple.html
executable file
·151 lines (137 loc) · 5.8 KB
/
issimple.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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Image Service 101</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.17/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.17/esri/css/esri.css">
<style>
html, body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
/*rounded
corners and opacity not supported in all browsers*/
.shadow {
padding: 8px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
-moz-box-shadow: 0px 6px 3px -3px #888;
-webkit-box-shadow: 0px 6px 3px -3px #888;
box-shadow: 0px 6px 3px -3px #888;
background-color: white;
}
#searchWindow {
position: absolute;
left: 80px;
top: 25px;
z-index: 999;
text-align: left;
}
#floatingWindow {
position: absolute;
right: 25px;
top: 15px;
z-index: 998;
width: 260px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border: solid 3px #028482;
color: #000000;
padding: 10px;
font-family: "Tahoma";
text-align: left;
}
#title {
padding-left: 10px;
}
.collapse {
display: none;
}
</style>
<script type="text/javascript">
var djConfig = {
parseOnLoad: false
};
</script>
<script type="text/javascript" src="//js.arcgis.com/3.17/">
</script>
<script type="text/javascript">
var imageServiceLayer, map, zoomTo;
require(["dojo/parser", "dojo/dom-class",
"dojo/ready",
"esri/map", "esri/IdentityManager", "esri/dijit/Geocoder", "esri/layers/ArcGISTiledMapServiceLayer", "esri/layers/ArcGISImageServiceLayer",
"esri/layers/RasterFunction", "esri/layers/ImageServiceParameters", "esri/layers/MosaicRule",
"esri/geometry/Extent", "esri/SpatialReference",
"dijit/form/RadioButton",
"dijit/form/CheckBox",
"dijit/form/TextBox",
"dijit/form/Button",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dijit/ProgressBar",
"dijit/form/HorizontalSlider", "dijit/form/HorizontalRule", "dijit/form/HorizontalRuleLabels", "dojox/form/RangeSlider", "dojox/gauges/GlossyCircularGauge", "dojo/on", "dojo/dom", "dijit/registry", "dojox/charting/widget/Chart2D", "dojox/charting/themes/Claro", "dojo/domReady!"
], function (parser, domClass, ready, Map, esriId, Geocoder, ArcGISTiledMapServiceLayer, ArcGISImageServiceLayer, RasterFunction, ImageServiceParameters, MosaicRule,
Extent, SpatialReference, RadioButton, CheckBox, TextBox, Button, BorderContainer, ContentPane, ProgressBar, HorizontalSlider, HorizontalRule, HorizontalRuleLabels, RangeSlider, GlossyCircularGauge, on, dom, registry, Chart2D, Claro) {
parser.parse();
//16116 29859
esri.config.defaults.io.corsEnabledServers.push("http://localhost:6080");
esri.config.defaults.io.corsEnabledServers.push("http://sampleserver6.arcgisonline.com");
esri.config.defaults.io.corsEnabledServers.push("http://landsat.arcgis.com");
var worldExtent = new Extent(-18299042.112232726, -5843983.938206653, 15533821.095456108, 10964824.329812262, new SpatialReference(3857));
var torontoExtent = new Extent(-8871156.887999881, 5395849.535498785, -8805077.077047433, 5428679.2391472235, new SpatialReference(3857));
map = new Map("map", {
wrapAround180: true,
extent: worldExtent,
});
var basemap = new ArcGISTiledMapServiceLayer("http://imagery.arcgisonline.com/arcgis/rest/services/LandsatGLS/LandsatShadedBasemap/ImageServer");
map.addLayer(basemap);
var mosaicRule = new MosaicRule(
{
"method": "esriMosaicCenter"
});
var params = new ImageServiceParameters();
params.bandIds = [3, 2, 1];//0 based index
params.mosaicRule = mosaicRule;
params.format = "jpgpng";
var rasterFunction = new RasterFunction();
var arguments = {};
var isUrl = "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Toronto/ImageServer";
imageServiceLayer = new ArcGISImageServiceLayer(isUrl, { imageServiceParameters: params });
map.addLayer(imageServiceLayer);
var geocoder = new Geocoder({
map: map
}, "search");
geocoder.startup();
zoomTo = function (val) {
if (val === "Toronto")
map.setExtent(torontoExtent);
else
map.setExtent(worldExtent);
};
});
</script>
</head>
<body class="claro">
<div dojotype="dijit/layout/BorderContainer" design="headline" gutters="false" style="width: 100%; height: 100%; margin: 0;">
<div id="map" dojotype="dijit/layout/ContentPane" region="center" style="overflow:hidden;position:relative;">
<div id="map_draw_status" class="collapse">
<div data-dojo-type="dijit/ProgressBar" data-dojo-props='indeterminate:"true", label: "loading...", style:"width:100px"'></div>
</div>
<div id="searchWindow"><div id="search"></div></div>
<div id="floatingWindow">
<div class="shadow">
<div id="title">
<span>This app shows how to access tiled and dynamic image services.</span>
</div>
<button data-dojo-type="dijit/form/Button" data-dojo-id="analysis" onclick="zoomTo('Toronto');" type="button">Toronto</button>
<button data-dojo-type="dijit/form/Button" data-dojo-id="analysis" onclick="zoomTo('World');" type="button">World</button>
</div>
</div>
</div>
</div>
</body>
</html>