-
Notifications
You must be signed in to change notification settings - Fork 4
/
repair.html
386 lines (329 loc) · 12.9 KB
/
repair.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
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
<!DOCTYPE html>
<html lang="en">
<head >
<meta charset="utf-8">
<meta name="viewport" content="width-device-width,initial-scal=1.0">
<meta name="description" content="SignUp">
<meta name="author" content="vishal Mane">
<title> Find Mechanics </title>
<link rel="stylesheet" href="normalize.css">
<link href="https://fonts.googleapis.com/css?family=Raleway:400,900" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css?family=Raleway:400,900" rel="stylesheet">
<link rel="stylesheet" href="css/map.css">
<link rel="stylesheet" href="repair.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<style>
</style>
</head>
<body>
<nav class="navbar navbar-expand-md bg-dark navbar-dark ">
<a style="margin-left: 2em;" class="navbar-brand" href="#">RoadSide-Assistant</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse design " id="collapsibleNavbar">
<div class="container">
<div class="row">
<div class="col-sm-4">
<li class="nav-item">
<a class="nav-link" href="index.html"><i style="font-size: 1em; " class="fa fa-home"></i> Home</a>
</li>
</div>
<div class="col-sm-4">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="navbardrop" data-toggle="dropdown" href="#"> Menu</a>
<div class="dropdown-menu design1">
<a class="dropdown-item" href="gas-station.html">Gas-Station NearMe</a>
<a class="dropdown-item" href="repair.html">Garage NearMe</a>
<a class="dropdown-item" href="#">Emergency HelpLine</a>
</div>
</li>
</div>
<div class="col-sm-4">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="navbardrop" data-toggle="dropdown" href="#"> More</a>
<div class="dropdown-menu design1">
<a class="dropdown-item" href="#">About Us </a>
<a class="dropdown-item" href="#">Connect US</a>
<a class="dropdown-item" href="#"></a>
</div>
</li>
</div>
</div>
</div>
</div>
</nav>
<header class="background">
<div id="findmechanics">
<h1> Find Mechanics in</h1>
<h4> Maharashatra, Gujrat,Rajastran,Delhi,Tamilnadu
</h4>
</div>
<div class="container">
<div class="row" style="margin-top:10%; margin-bottom: 2%;">
<div id="locationField" class="col-sm-4 col-12" >
<input id="autocomplete" placeholder="Enter a city" type="text" />
</div>
<div id="controls" class="col-sm-4 col-12">
<select id="state">
<option value="all">All</option>
<option value="mh" selected >Maharashtra</option>
<option value="gj" >Gujrat</option>
<option value="rj">Rajastan</option>
<option value="tn">TamilNadu</option>
<option value="dh">Delhi</option>
</select>
</div>
</div>
</div>
</header>
<div class="container">
<div class="row">
<script>
var map, places, infoWindow;
var markers = [];
var autocomplete;
var StateRestrict = {'state': 'mh'};
var MARKER_PATH = 'https://developers.google.com/maps/documentation/javascript/images/marker_green';
var hostnameRegexp = new RegExp('^https?://.+?/');
var states = {
'mh': {
center: {lat:19.9915 , lng:76.5139 },
zoom: 6.9
},
'gj': {
center: {lat: 22.2587, lng:71.1924 },
zoom: 7
},
'rj': {
center: {lat:27.0238 , lng:74.2179 },
zoom: 6.5
},
'tn': {
center: {lat:11.1271 , lng: 78.6569},
zoom: 7.3
},
'dh': {
center: {lat: 28.7041, lng:77.1025 },
zoom: 7.3
}
};
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
zoom: states['mh'].zoom,
center: states['mh'].center,
mapTypeControl: false,
panControl: false,
zoomControl: false,
streetViewControl: false
});
infoWindow = new google.maps.InfoWindow({
content: document.getElementById('info-content')
});
autocomplete = new google.maps.places.Autocomplete(
/** @type {!HTMLInputElement} */ (
document.getElementById('autocomplete')), {
types: ['(cities)'],
componentRestrictions: StateRestrict
});
places = new google.maps.places.PlacesService(map);
autocomplete.addListener('place_changed', onPlaceChanged);
document.getElementById('state').addEventListener(
'change', setAutocompleteCountry);
}
function onPlaceChanged() {
var place = autocomplete.getPlace();
if (place.geometry) {
map.panTo(place.geometry.location);
map.setZoom(15);
search();
} else {
document.getElementById('autocomplete').placeholder = 'Enter a city';
}
}
function search() {
var search = {
bounds: map.getBounds(),
types: ['car_repair']
};
places.nearbySearch(search, function(results, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
clearResults();
clearMarkers();
for (var i = 0; i < results.length; i++) {
var markerLetter = String.fromCharCode('A'.charCodeAt(0) + (i % 26));
var markerIcon = MARKER_PATH + markerLetter + '.png';
// Use marker animation to drop the icons incrementally on the map.
markers[i] = new google.maps.Marker({
position: results[i].geometry.location,
animation: google.maps.Animation.DROP,
icon: markerIcon
});
markers[i].placeResult = results[i];
google.maps.event.addListener(markers[i], 'click', showInfoWindow);
setTimeout(dropMarker(i), i * 100);
addResult(results[i], i);
}
}
});
}
function clearMarkers() {
for (var i = 0; i < markers.length; i++) {
if (markers[i]) {
markers[i].setMap(null);
}
}
markers = [];
}
function setAutocompleteCountry() {
var state = document.getElementById('state').value;
if (state == 'all') {
autocomplete.setComponentRestrictions({'state': []});
map.setCenter({lat: 15, lng: 0});
map.setZoom(2);
} else {
autocomplete.setComponentRestrictions({'country': 'in'});
map.setCenter(states[state].center);
map.setZoom(states[state].zoom);
}
clearResults();
clearMarkers();
}
function dropMarker(i) {
return function() {
markers[i].setMap(map);
};
}
function addResult(result, i) {
var results = document.getElementById('results');
var markerLetter = String.fromCharCode('A'.charCodeAt(0) + (i % 26));
var markerIcon = MARKER_PATH + markerLetter + '.png';
var tr = document.createElement('tr');
tr.style.backgroundColor = (i % 2 === 0 ? '#F0F0F0' : '#FFFFFF');
tr.onclick = function() {
google.maps.event.trigger(markers[i], 'click');
};
var iconTd = document.createElement('td');
var nameTd = document.createElement('td');
var icon = document.createElement('img');
icon.src = markerIcon;
icon.setAttribute('class', 'placeIcon');
icon.setAttribute('className', 'placeIcon');
var name = document.createTextNode(result.name);
iconTd.appendChild(icon);
nameTd.appendChild(name);
tr.appendChild(iconTd);
tr.appendChild(nameTd);
results.appendChild(tr);
}
function clearResults() {
var results = document.getElementById('results');
while (results.childNodes[0]) {
results.removeChild(results.childNodes[0]);
}
}
function showInfoWindow() {
var marker = this;
places.getDetails({placeId: marker.placeResult.place_id},
function(place, status) {
if (status !== google.maps.places.PlacesServiceStatus.OK) {
return;
}
infoWindow.open(map, marker);
buildIWContent(place);
});
}
function buildIWContent(place) {
document.getElementById('iw-icon').innerHTML = '<img class="hotelIcon" ' +
'src="' + place.icon + '"/>';
document.getElementById('iw-url').innerHTML = '<b><a href="' + place.url +
'">' + place.name + '</a></b>';
document.getElementById('iw-address').textContent = place.vicinity;
if (place.formatted_phone_number) {
document.getElementById('iw-phone-row').style.display = '';
document.getElementById('iw-phone').textContent =
place.formatted_phone_number;
} else {
document.getElementById('iw-phone-row').style.display = 'none';
}
if (place.rating) {
var ratingHtml = '';
for (var i = 0; i < 5; i++) {
if (place.rating < (i + 0.5)) {
ratingHtml += '✩';
} else {
ratingHtml += '✭';
}
document.getElementById('iw-rating-row').style.display = '';
document.getElementById('iw-rating').innerHTML = ratingHtml;
}
} else {
document.getElementById('iw-rating-row').style.display = 'none';
}
if (place.website) {
var fullUrl = place.website;
var website = hostnameRegexp.exec(place.website);
if (website === null) {
website = 'http://' + place.website + '/';
fullUrl = website;
}
document.getElementById('iw-website-row').style.display = '';
document.getElementById('iw-website').textContent = website;
} else {
document.getElementById('iw-website-row').style.display = 'none';
}
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDCtXv7oBm2rej_95Xvh17IJfxdt4g0ybg&libraries=places&callback=initMap"
async defer></script>
<div>
</div>
<div class="col">
<div id="map"></div>
<div id="listing">
<table id="resultsTable">
<tbody id="results"></tbody>
</table>
</div>
<div style="display: none">
<div id="info-content">
<table>
<tr id="iw-url-row" class="iw_table_row">
<td id="iw-icon" class="iw_table_icon"></td>
<td id="iw-url"></td>
</tr>
<tr id="iw-address-row" class="iw_table_row">
<td class="iw_attribute_name">Address:</td>
<td id="iw-address"></td>
</tr>
<tr id="iw-phone-row" class="iw_table_row">
<td class="iw_attribute_name">Telephone:</td>
<td id="iw-phone"></td>
</tr>
<tr id="iw-rating-row" class="iw_table_row">
<td class="iw_attribute_name">Rating:</td>
<td id="iw-rating"></td>
</tr>
<tr id="iw-website-row" class="iw_table_row">
<td class="iw_attribute_name">Website:</td>
<td id="iw-website">></td>
</tr>
<tr id="iw-button" class="iw_table_row">
<td class="iw_attribute_name"><button type="button" class="button"><a href="service.html">Request</a>
</button></td>
<td class="iw_attribute_name"><button type="button" class="button"><a href="tel:place.formatted_phone_number">Call</a>
</button></td>
<td id="iw-call"></td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</body>
</html>