-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
82 lines (60 loc) · 2.25 KB
/
index.js
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
var place
window.onload = (event) => {
swal({
title: "Where are you now?",
text: "Please fill it correctly so that we can customize our site according to location.",
type: "input",
showCancelButton: false,
closeOnConfirm: false,
animation: "slide-from-top",
inputPlaceholder: "City/Town/Village"
},
function(inputValue) {
place = inputValue
if (inputValue === null) return false;
if (inputValue === "") {
swal.showInputError("Please write something!");
return false
}
swal("Thanks!", "You are near: " + inputValue, "success");
// console.log(place)
});
}
map = document.getElementById('maps')
// console.log(map.src)
var mapId
var Place
mapPolice = document.getElementById('mapPolice')
mapFire = document.getElementById('mapFire')
mapAmbu = document.getElementById('mapAmbu')
mapPolice.addEventListener('click', police)
mapFire.addEventListener('click', fire)
mapAmbu.addEventListener('click', ambu)
function police() {
var mapId = 'police%20station'
map.src = 'https://www.google.com/maps/embed/v1/search?q=' + mapId + '%20in%20' + place + '&key=AIzaSyDd2AeyXCohymH6I8R7XrtPlxvpm4e2Xls'
console.log(map.src)
}
function fire() {
var mapId = 'fire%20station'
map.src = 'https://www.google.com/maps/embed/v1/search?q=' + mapId + '%20in%20' + place + '&key=AIzaSyDd2AeyXCohymH6I8R7XrtPlxvpm4e2Xls'
console.log(map.src)
}
function ambu() {
var mapId = 'hospitals'
map.src = 'https://www.google.com/maps/embed/v1/search?q=' + mapId + '%20in%20' + place + '&key=AIzaSyDd2AeyXCohymH6I8R7XrtPlxvpm4e2Xls'
// document.body.style.backgroundColor = 'Pink'
}
// map.src = 'https://www.google.com/maps/embed/v1/search?q=' + { mapId } + '%20in%20bhopal&key=AIzaSyDd2AeyXCohymH6I8R7XrtPlxvpm4e2Xls'
// Updates
updates = document.getElementById('updates')
updates.style.display = 'none'
corona = document.getElementById('corona')
corona.addEventListener('click', update)
function update() {
if (updates.style.display == 'none') {
updates.style.display = 'block'
} else {
updates.style.display = 'none'
}
}