-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAboutUs.html
103 lines (89 loc) · 2.74 KB
/
AboutUs.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
<!DOCTYPE html>
<html>
<body>
<h1>My First Google Map</h1>
<div id="googleMap" style="width:100%;height:650px;"></div>
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/7.14.1/firebase.js"></script>
<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#available-libraries -->
<script>
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "AIzaSyCpwclbPG8eQcr4jmF5J3U4d-I_SbeHIDY",
authDomain: "covid19-ba857.firebaseapp.com",
databaseURL: "https://covid19-ba857.firebaseio.com",
projectId: "covid19-ba857",
storageBucket: "covid19-ba857.appspot.com",
messagingSenderId: "133848837781",
appId: "1:133848837781:web:3b98bcf24bc98282e8759c"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
</script>
<script>
firebase.database().ref().child("locations").child("pkj").child("location").on("value",function(snapshot){
myMap(snapshot.val().lat,snapshot.val().long);
});
let markers = [];
let sales = [{
"name": "PKJ",
"lat": "19.9975",
"lng": "73.7898"
}]
var map;
window.onload=()=>
{
var mapProp= {
center:new google.maps.LatLng(20.5937,74.7893),
zoom:5,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("googleMap"),mapProp);
}
function myMap(lat,long) {
//alert(lat+" "+long);
var loc={
"name":"abc",
"lat":""+lat,
"long":""+long
}
//sales.push(loc);
let newMarker = new google.maps.Marker({
position: new google.maps.LatLng(lat,long),
map: map,
title: "new",
});
newMarker.setMap(map);
/*
let infowindow = new google.maps.InfoWindow();
let bounds = new google.maps.LatLngBounds();
if (sales) {
for (let i = 0; i < sales.length; i++) {
let newMarker = new google.maps.Marker({
position: new google.maps.LatLng(sales[i].lat, sales[i].lng),
map: map,
title: sales[i].name,
});
google.maps.event.addListener(newMarker, 'click', (function(newMarker, i) { return function()
{
infowindow.setContent('<h3>' + sales[i].name + '</h3>');
infowindow.open(map, newMarker);
}
})(newMarker, i));
bounds.extend(newMarker.getPosition());
markers.push(newMarker);
}
}
*/
//setMapOnAll(null);
}
function setMapOnAll(map) {
for (var i = 0; i < markers.length; i++) {
markers[i].setMap(map);
}
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBhUVoPae8yP_OWTfEUBEinTMb4lMZz_lg"></script>
</body>
</html>