-
Notifications
You must be signed in to change notification settings - Fork 159
/
index.html
174 lines (153 loc) · 4.42 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="lib/codemirror/codemirror.css" rel="stylesheet" />
<script src="lib/codemirror/codemirror.js"></script>
<script src="lib/codemirror/javascript.js"></script>
<script src="lib/jQuery/jquery-2.1.0.min.js"></script>
<title>Mapping API Demo</title>
<style>
@font-face {
font-family: 'ACMuli';
src: url('content/fonts/ACMuli/AC-Muli.ttf')
}
@font-face {
font-family: 'ACMuliLight';
src: url('content/fonts/ACMuliLight/AC-MuliLight.ttf')
}
body{
font-size: 14px;
color: #4E59A4;
font-family: 'ACMuli';
}
.container{
margin-left: auto;
margin-right: auto;
}
.btn {
font-size: 14px;
width: 102px;
height: 30px;
border-radius: 0;
border: 2px #4E59A4 solid;
background: #fff;
color: #4E59A4;
text-shadow: none;
box-shadow: none;
}
.btn:hover, .btn-hover{
cursor: pointer;
border-radius: 0;
background: #4E59A4;
color: #fff !important;
border: 2px #4E59A4 solid;
}
.globe{
width:40px;
height:40px;
margin-right:10px;
}
.logo{
display: block;
}
.title{
display: block;
margin-left: 30px;
}
.menu{
margin-bottom: 40px;
}
.menu .btn{
margin-left: 20px;
}
.continue{
display: block;
float: left;
width: 48vw;
position: relative;
}
.continue button{
margin-left:20px;
margin-top:20px;
}
#map-container{
padding: 0;
border: none;
margin: 0;
width: 45vw;
height: 400px;
float:right;
margin-right:40px;
}
#sample{
position : relative;
display: block;
width: 500px;
font-size: 13px;
font-family: 'ACMuliLight'
}
.CodeMirror{
height: 80vh;}
</style>
</head>
<body>
<div class="container">
<div class="logo"> <a href="/"><img class="globe" src="images/Geodata_logo.svg"><img src="images/geodata-biglogo.png"></a> </div>
<div class="menu">
<span class="title"><h2>Mapping API Demo</h2></span>
<a href="#"><button id="leaflet" class="btn">Leaflet</button></a>
<a href="#"><button id="openlayers" class="btn">OpenLayers</button></a>
</div>
<div class="continue">
<div class="clearfix" style="">
<textarea id="sample">
</textarea>
</div>
</div>
<iframe id="map-container" src="openlayers.html" ></iframe>
</div>
<script>
$(document).ready(function(){
var editor = CodeMirror.fromTextArea(document.getElementById("sample"), {
lineNumbers: true,
mode: "text/javascript",
matchBrackets: true,
lineWrapping: true,
});
//var script = $("#map-container").contents().find('#common-script').text();
var script;
var hscript;
$.ajax({
url: 'common-script.js',
dataType: "text",
success: function(response){
script = response;
$("#map-container").load(function(){
hscript = $("#map-container").contents().find('#header-script').html();
//script = $("#map-container").contents().find('#common-script').text();
editor.setValue(hscript+script);
});
},
});
// On leaflet button click
$("#leaflet").on("click", function(){
$("#map-container").attr('src',"leaflet.html");
$("#map-container").load(function(){
hscript = $("#map-container").contents().find('#header-script').html();
//script = $("#map-container").contents().find('#common-script').text();
editor.setValue(hscript+script);
});
});
// On openlayers button click
$("#openlayers").on("click", function(){
$("#map-container").attr('src',"openlayers.html");
$("#map-container").load(function(){
hscript = $("#map-container").contents().find('#header-script').html();
//script = $("#map-container").contents().find('#common-script').text();
editor.setValue(hscript+script);
});
});
});
</script>
</body>
</html>