-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexplore.html
More file actions
215 lines (202 loc) · 5.12 KB
/
explore.html
File metadata and controls
215 lines (202 loc) · 5.12 KB
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>地圖</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<!-- font awesome -->
<style>
html, body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
#map {
height: 100%;
width: 100%;
}
#functions-wrapper {
position: fixed;
top: 10px;
left: 10px;
}
/*FUNCTION CSS*/
.body {
width:100%;
height:100%;
}
.group {
position:relative;
}
input {
font-size: 0.9em;
padding:10px 10px 10px 5px;
display:block;
width: 11em;
border:none;
border-bottom:1px solid #757575;
position: relative;
left: 1em;
background: white;
border: 1px solid rgba(20,20,20,0.5);
box-shadow: 0 0 5px rgba(20,20,20,0.5);
}
input:focus {
outline:none;
}
label {
color:#999;
font-size: 1em;
font-weight:normal;
position:absolute;
pointer-events:none;
top: 0.75em;
left: 1.5em;
transition:0.2s ease all;
-moz-transition:0.2s ease all;
-webkit-transition:0.2s ease all;
}
input:focus ~ label, input:valid ~ label {
left: -10em;
font-size: 10px;
color:#5264AE;
}
input:focus ~ .bar:before, input:focus ~ .bar:after {
width:80%;
}
.highlight {
position:absolute;
height:10%;
width: 30px;
top: 10em;
left:0;
pointer-events:none;
opacity:0.5;
}
input:focus ~ .highlight {
-webkit-animation:inputHighlighter 0.3s ease;
-moz-animation:inputHighlighter 0.3s ease;
animation:inputHighlighter 0.3s ease;
}
@-webkit-keyframes inputHighlighter {
from { background:#5264AE; }
to { width:0; background:transparent; }
}
@-moz-keyframes inputHighlighter {
from { background:#5264AE; }
to { width:0; background:transparent; }
}
@keyframes inputHighlighter {
from { background:#5264AE; }
to { width:0; background:transparent; }
}
.functions-wrapper form, i {
display: inline-block;
vertical-align: middle;
}
.search-icon {
cursor: pointer;
font-size: 1.5em;
margin-left: 1em;
}
.search-wrapper, .search-icon {
display: inline-block;
vertical-align: middle;
}
.oth-icon {
font-size: 1.5em;
vertical-align: middle;
margin-left: 0.5em;
color: rgba(20,20,20,0.9);
margin-left: 0.8em;
margin-top: 0.3em;
cursor: pointer;
}
</style>
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3&key=AIzaSyBm3Vv7k-8DiE_uBvptymYypVtYlGnqF8g&signed_in=true&sensor=true"></script>
<script type="text/javascript" src="explore.js"></script>
<script type="text/javascript">
var btns = {
"#hospitals" : hospitals,
"#parks": parks,
"#restaurants": restaurants
};
function onMarkBtnClicked() {
var id = "#" + $(this).attr("id");
markSites(window.map, btns[id]);
}
var tracking = false;
var shown_path = null;
function onTrackPathClicked() {
if(false == tracking) {
startTrackingPath();
tracking = true;
$(this).text("結束紀錄");
if(shown_path != null) {
shown_path.setMap(null);
}
shown_path = null;
}
else {
path = stopTrackingPath();
tracking = false;
$(this).text("紀錄路徑");
shown_path = createPath(path);
shown_path.setMap(window.map);
}
}
$( document ).ready(function() {
for(var id in btns) {
$(id).on("click", onMarkBtnClicked);
}
$("#move_to").on("click", function() {
moveToAddress(window.map, $("#address").val());
});
$("#current_location").on("click", function() {
centerOnCurrentLocation(window.map);
});
$("#track_path").on("click", onTrackPathClicked);
});
</script>
</head>
<body onload = "initMap();">
<div id="map"></div>
<div id="functions-wrapper">
<div class="function-header">
<div class="search-wrapper">
<form>
<div class="group">
<input type="text" required id="address">
<span class="highlight"></span>
<label>前往指定地址</label>
</div>
</form>
</div>
<div class="search-icon">
<i class="fa fa-search" id="move_to"></i>
</div>
<div class="oth-icon">
<i class="fa fa-map-marker" id="current_location"></i>
<i class="fa fa-road" id="track_path" style="margin-left:5px"></i>
</div>
</div>
</div>
<!-- <button id="hospitals">醫院</button>
<button id="parks">公園</button>
<button id="restaurants">寵物餐廳</button>
<button id="friends">朋友</button>
<br />
<input id="address" placeholder="請輸入地址" />
<button id="move_to">移到</button>
<button id="current_location">目前位置</button>
<button id="track_path">紀錄路徑</button> -->
</div>
<!--
<script async defer
src="https://maps.googleapis.com/maps/api/js?v=3&key=AIzaSyBm3Vv7k-8DiE_uBvptymYypVtYlGnqF8g&signed_in=true&callback=initMap&sensor=true"></script>
-->
</body>
</html>