1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Tranistional//EN"
3
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
<script type="text/javascript">
7
if (navigator.userAgent.indexOf('MSIE') > -1 && navigator.userAgent.indexOf('Mac') > -1) {
8
location.href = "html/notsupported.html";
11
<script src="lib/prototype/prototype.js" type="text/javascript"></script>
12
<script src="lib/scriptaculous/scriptaculous.js" type="text/javascript"></script>
13
<script src="lib/SunViewer/DomNodeCache.js" type="text/javascript"></script>
14
<script src="lib/SunViewer/AjaxRequestWrapper.js" type="text/javascript"></script>
15
<script src="lib/SunViewer/SunViewerWidget.js" type="text/javascript"></script>
16
<script src="lib/SunViewer/SunImage.js" type="text/javascript"></script>
17
<script src="lib/SunViewer/tiles.js" type="text/javascript"></script>
18
<script src="lib/SunViewer/Surface.js" type="text/javascript"></script>
19
<script src="lib/SunViewer/overlays.js" type="text/javascript"></script>
20
<script src="lib/SunViewer/markers.js" type="text/javascript"></script>
21
<script src="lib/SunViewer/layers.js" type="text/javascript"></script>
22
<script src="lib/SunViewer/InfoBubble.js" type="text/javascript"></script>
23
<script src="lib/SunViewer/ViewPort.js" type="text/javascript"></script>
24
<script src="lib/SunViewer/LayerManager.js" type="text/javascript"></script>
25
<script src="lib/SunViewer/ZoomLevelSlider.js" type="text/javascript"></script>
26
<script src="lib/SunViewer/SunCoordsDisplay.js" type="text/javascript"></script>
27
<script src="lib/SunViewer/SizeIndicator.js" type="text/javascript"></script>
28
<script src="lib/SunViewer/SelectByDateMenu.js" type="text/javascript"></script>
29
<script src="lib/SunViewer/SunViewer.js" type="text/javascript"></script>
30
<script type="text/javascript">
34
var maximized = false;
36
function initializeGraphic(e) {
39
// opera triggers the onload twice
40
if (sunViewer == null) {
41
// NOTE: This should all be encapsulated in the SunViewer class!
43
var viewport1 = new ViewPort('sunViewer1.viewport1', {
46
blankTileImage: 'images/icons/blank.gif',
47
loadingTileImage: 'images/icons/progress.gif' //,
48
//tileLayerProviders: [
49
// new MarkerLayerProvider()
54
// Create tile containers
55
var tiles1 = new TileContainer(viewport1);
56
var layerManager1 = new LayerManager(tiles1, 'layerManager1');
58
// Create tile layer providers
59
var bg1 = new TileLayerProvider(tiles1);
60
//var debug1 = new TileDebugLayerProvider(tiles1);
61
//var debug2 = new TileDebugLayerProvider(tiles2, { color: 'red' });
62
var markers1 = new MarkerLayerProvider(tiles1);
64
//var menu1 = new SelectByDateMenu('sunViewer1.menu1');
65
//$('layerManager1').appendChild(menu1.createHtmlElement());
66
//var menu2 = new SelectByDateMenu('sunViewer1.menu2');
67
//$('layerManager1').appendChild(menu2.createHtmlElement());
68
var zoomLevelSlider = new ZoomLevelSlider('sunViewer1.viewport1.zoomLevelSlider');
69
var sizeIndicator = new SizeIndicator('sunViewer1.viewport1.sizeIndicator', bg1);
70
var sunCoordsDisplay = new SunCoordsDisplay('sunViewer1.viewport1.sunCoordsDisplay', bg1);
71
// Link menu to tile layer providers
72
zoomLevelSlider.linkToViewports(viewport1);
73
//bg1.observe(menu1, 'ImageChange');
74
//bg2.observe(menu2, 'ImageChange')
75
markers1.observe(bg1, 'ImageChange');
76
markers1.observe(bg1, 'ZoomOffsetChange');
85
var LoadingIndicator = Class.create();
87
LoadingIndicator.prototype = {
88
initialize: function() {
89
//this.loadingItemCount = 0;
90
this.loadingItems = [];
92
Ajax.Responders.register({
93
onCreate: this.loadingStarted.bind(this, 'Ajax'),
94
onComplete: this.loadingFinished.bind(this, 'Ajax')
107
this.loadingItemCount = 0;
111
loadingStarted: function(item) {
112
//if (!item) item = new object();
114
this.loadingItems.push(new Object());
115
//++this.loadingItemCount;
116
//Debug.output('Loading started: ' + item + ' (' + this.loadingItems.length + ')');
119
loadingFinished: function(item) {
120
this.loadingItems.pop();
121
if (this.loadingItems.length == 0) this.hide();
122
//if (this.loadingItemCount < 0) this.loadingItemCount = 0;
123
//Debug.output('Loading finished: ' + item + ' (' + this.loadingItems.length + ')');
127
var Debug = Class.create();
129
Debug.outputBuffer = '';
131
Debug.loadingItemCount = 0;
133
Debug.loadingIndicator = new LoadingIndicator();
135
Debug.test = function(xIndex, yIndex, level) {
138
for (var l = 0; l <= level; l++) {
139
var x = (xIndex >> (level - l + 1)) / (1 << l);
140
var x2 = 1 / (1 << l + 1);
141
Debug.output(x, (1<<l), (xIndex >> (level - l)), x2);
145
Debug.output = function() {
148
for (var i = 0; i < arguments.length; i++) {
150
if (i < arguments.length - 1) txt += ', ';
153
if (window.console) {
154
window.console.log(txt);
156
if (Debug.outputTimeout) clearTimeout(Debug.outputTimeout);
157
Debug.outputBuffer = txt + '\n' + Debug.outputBuffer;
158
Debug.outputTimeout = setTimeout(Debug.flush, 100);
162
Debug.plotArray = function(a) {
163
Debug.output('----\n' + Debug.strArray(a, '', 0));
166
Debug.strArray = function(a, indent, index) {
167
//Debug.output(typeof(a), a instanceof Array);
168
if (a instanceof Array) {
169
if (a.length == 0) return indent + index + ': []\n';
170
var txt = indent + index + ': [\n';
173
txt += Debug.strArray(m, indent + ' ', c)
176
return txt + indent + ']\n';
178
return indent + index + ': ' + a + '\n';
182
Debug.flush = function() {
183
$('debugOutput').innerHTML = '----\n' + Debug.outputBuffer + $('debugOutput').innerHTML;
184
Debug.outputBuffer = '';
187
Debug.ajaxFailure = function(transport, url) {
188
Debug.output('Error getting file "' + url + '": ' + transport.status + ' ' + transport.statusText);
191
Event.observe(window, 'load', initializeGraphic);
194
<style type="text/css">
195
@import url(styles/sunviewer.css);
196
@import url(styles/sizeIndicator.css);
201
<div><span id="loading" style="padding: 3px; font-size: 10pt; color: #FFFFFF; background-color: #990000; position: absolute; top: 30px; right: 30px; display: none">Loading...</span></div>
202
<div id="sunViewer1.header" class="header">
203
<h1>SunViewer (alpha)</h1>
205
<a class="nav" onclick="SunViewer.showMessage('html/about.html')">About</a>
209
<table border="0" cellspacing="0" cellpadding="2">
212
<button type="button" onclick="viewerBean.centreImage()">Centre</button>
213
<button type="button" onclick="viewerBean.reset()">Reset</button>
214
</td><td width="150">
215
<span id="coordinates" style="margin-left: 20px">
217
<span id="NorS" style="width: 10px"></span>
218
<span id="NorSdeg" style="width: 20px; text-align: right"></span>
219
<span id="WorE" style="width: 10px"></span>
220
<span id="WorEdeg" style="width: 20px; text-align: right"></span>
223
<span id="rotation" style="margin-left: 20px">
225
<span id="RNorS" style="width: 10px">S</span>
226
<span id="RNorSdeg" style="width: 20px; text-align: right">0</span>
227
<span id="RWorE" style="width: 10px">W</span>
228
<span id="RWorEdeg" style="width: 20px; text-align: right">0</span>
234
<div style="clear: left"></div>
235
<div style="z-index: 1; position: relative; width: 600px; margin-right: 10px; margin-bottom: 10px; display: inline; float: left">
237
<div id="layerManager1" class="layerManager" style="position: absolute; z-index: 2; height: 15px; width: 70px; overflow: hidden; margin-bottom: 10px">
239
<div id="sunViewer1.viewport1" class="viewport" style="z-index: 0; left: 0px; width: 100%; height: 600px">
240
<div class="surface" id="surface1">
243
<div class="well" id="well1">
246
<div id="sunViewer1.viewport1.zoomLevelSlider" class="viewportControls" style="position: absolute; left: 10px; top: 35px; text-align: center; padding: 2px 4px 2px 4px">
247
<a href="JavaScript:void(0);" class="zoomIn" title="Zoom In">
248
<img src="images/icons/zoomIn.gif" alt="" border="0" style="margin: 0px 0px 00px 0px" />
251
<div class="zoomLevelContainer">
255
<a href="JavaScript:void(0);" class="zoomOut" title="Zoom Out">
256
<img src="images/icons/zoomOut.gif" alt="" border="0" style="margin: 0px 0px 0px 0px" />
259
<div id="sunViewer1.viewport1.sunCoordsDisplay" class="sunCoordsDisplay" style="position: absolute; right: 10px; top: 10px;">
262
<div class="sizeIndicator" id="sunViewer1.viewport1.sizeIndicator" style="left: 10px; top: 545px">
264
<!-- div class="viewportControls" style="left: 0px; bottom: 0px; height: 20px; padding: 0px 4px 0px 4px; margin: 0px">
265
<span class="centerControl">Center</span>