-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
147 lines (113 loc) · 6.56 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Map Sheets Creator</title>
<link type="text/css" href="thirdparty/css/no-theme/jquery-ui-1.8.5.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.4.2.min.js" ></script>
<script type="text/javascript" src="js/jquery-ui-1.8.5.custom.min.js"></script>
<script type="text/javascript" src="thirdparty/js/OpenLayers.js" ></script>
<script type="text/javascript" src="js/LayerSwitcherWithOrder.js " ></script>
<link type="text/css" href="css/sheetcomposer.css" rel="stylesheet" />
<script type="text/javascript" src="js/tracks.js" ></script>
<script type="text/javascript" src="js/mapsheetrectangle.js" ></script>
<script type="text/javascript" src="js/main.js" ></script>
<script type="text/javascript">
$(function() {
$( "#renderWidget" ).draggable({containment: '#map_canvas', zIndex: 2700});
});
</script>
<script type="text/javascript">
var map = {};
var gTestPolyline = {};
var gSheetController = {};
var gMapLayoutWidget = {};
// var gLogger = {};
var gRender = {};
var gTrackWidget = {};
var MAP_HOST_NAME = '';
function showAboutPage(event)
{
$('#aboutWindow').dialog({width:700,
modal: true,
title: 'Map Sheet Creator',
zindex: 30000});
}
function showHelpPage(event)
{
$('#helpWindow').dialog({width:700,
modal: true,
title: 'Some Instructions',
zindex: 30000});
}
function get_my_url (bounds) {
var res = this.map.getResolution();
var x = Math.round ((bounds.left - this.maxExtent.left) / (res * this.tileSize.w));
var y = Math.round ((this.maxExtent.top - bounds.top) / (res * this.tileSize.h));
var z = this.map.getZoom();
var path = "Z" + z + "/" + y + "_" + x + ".png";
var url = this.url;
if (url instanceof Array) {
url = this.selectUrl(path, url);
}
return url + path;
}
function initialize()
{
var slazavLayer = new OpenLayers.Layer.TMS("Slazav",
MAP_HOST_NAME + "/maps/slazav/",
{ 'type':'png', 'getURL':get_my_url, transparent: 'true' });
var arbaletLayer = new OpenLayers.Layer.TMS("Arbalet",
MAP_HOST_NAME + "/maps/arbalet/",
{ 'type':'png', 'getURL':get_my_url, transparent: 'true' });
var osmLayer = new OpenLayers.Layer.OSM();
var serverNamesMap = {};
serverNamesMap[slazavLayer.name] = 'slazav',
serverNamesMap[arbaletLayer.name] = 'arbalet';
map = new OpenLayers.Map("map_canvas", {
maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
numZoomLevels:18,
maxResolution:156543.0339,
units:'m',
projection: "EPSG:900913",
displayProjection: new OpenLayers.Projection("EPSG:4326"),
allOverlays: true
});
map.addLayers([osmLayer, arbaletLayer, slazavLayer]);
map.addControl( new OpenLayers.Control.LayerSwitcherWithOrder() );
var mapCenterLonLat = new OpenLayers.LonLat(37.98, 55.78)
map.setCenter(mapCenterLonLat.transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), 8);
//var curLogger = new DivLogger();
var curLogger = new NullLogger();
$("#divTrackWidget").css( { left: 50} );
//gLogger = curLogger;
var m_converter = new CoordinatesConverter( map );
var m_sheet = new Sheet( m_converter );
var m_sheetOptionsWidget = new SheetOptionsWidget( $("#sheetOptionsWidgetContainer"), curLogger, m_sheet );
var lonlatCenter = m_converter.map2lonlat( map.getCenter() );
var m_mapSheetRectangle = new MapSheetRectangle( map, lonlatCenter, curLogger, m_sheet );
gMapLayoutWidget = new MapLayoutWidget( map, serverNamesMap );
gTrackWidget = new TrackWidget( map );
//gRender = new LoadRenderWidget( gSheetController.getSheet(), gMapLayoutWidget, curLogger );
gRender = new RenderWidget( m_sheet, gMapLayoutWidget, curLogger );
//layout
$("#renderWidget").outerWidth( $("#sheetOptionsWidgetContainer").outerWidth() );
$("#renderWidget").css( { bottom: $("#sheetOptionsWidgetContainer").outerHeight()} );
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()" style="margin:0; padding:0; overflow:hidden;">
<div id="map_canvas" style="width: 100%; height: 100%; margin:0; padding:0; overflow:hidden;"></div>
<div id="renderWidget" class="ui-widget-content">
<form><input id= "renderButton", type="button" value="Render Sheet" style="width:100%" ></form>
<p id="download_link"></p>
</div>
<div id = "buttonContainer">
<div id="aboutButton" onclick="showAboutPage();">About</div>
<div id="helpButton" onclick="showHelpPage();">Help</div>
</div>
<!--#include virtual="sheet_options_widget.html" -->
<!--#include virtual="about.html" -->
<!--#include virtual="help.html" -->
<!--#include virtual="track_widget.html" -->
</body>
</html>