-
Notifications
You must be signed in to change notification settings - Fork 0
/
fmipa.html
executable file
·107 lines (98 loc) · 3.62 KB
/
fmipa.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
<!DOCTYPE html>
<html>
<head>
<title>FMIPA</title>
<style type="text/css">
html, body {
margin: 0px;
padding: 0px;
}
#map {
width: 100%;
height: 550px;
}
</style>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.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.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
</head>
<body>
<h1 style="text-align: center;">Sistem Informasi Pesebaran Asal Mahasiswa Unila</h1>
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<a class="navbar-brand" href="index.html">Home</a>
<!-- Links -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="top3.html">TOP 3</a>
</li>
<!-- Dropdown -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbardrop" data-toggle="dropdown">
Fakultas
</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="fmipa.html">FMIPA</a>
<a class="dropdown-item" href="fkip.html">FKIP</a>
<a class="dropdown-item" href="fisip.html">FISIP</a>
<a class="dropdown-item" href="fp.html">FP</a>
<a class="dropdown-item" href="ft.html">FT</a>
<a class="dropdown-item" href="fh.html">FH</a>
<a class="dropdown-item" href="fk.html">FK</a>
<a class="dropdown-item" href="feb.html">FEB</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="about.html">About</a>
</li>
</ul>
</nav>
<div id="map"></div>
<!-- Inisial backend -->
<script src="https://www.gstatic.com/firebasejs/5.0.1/firebase.js"></script>
<script defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBCx0yZKvuXFS6QawkRgVvmSw_xL7eDS_4&callback=initMap"></script>
<script type="text/javascript">
var map = null;
var center = {lat: -3.527115, lng: 119.602667};
var infowindow;
var config = {
apiKey: "AIzaSyCFTo2Ptcv4rm4INPcncz-WrtIsezv2mpI",
authDomain: "cobagis16.firebaseapp.com",
databaseURL: "https://cobagis16.firebaseio.com",
projectId: "cobagis16",
storageBucket: "cobagis16.appspot.com",
messagingSenderId: "568661144402"
};
firebase.initializeApp(config);
var db = firebase.database();
var dataRef = db.ref('fmipa');
dataRef.on('value', showData, showError);
function showData(data) {
console.log(data.val());
map.data.addGeoJson(data.val());
map.data.setStyle({
fillColor: '#AADAFF',
strokeWeight: 0.2
});
map.data.addListener('click', function(event){
infowindowcontent = '<b>'+event.feature.getProperty('Propinsi')+'</b>'+'<br><b>Jumlah Mahasiswa : </b>'+event.feature.getProperty('MAHASISWA')+'<br><b>Jumlah Penduduk : </b>'+event.feature.getProperty('PENDUDUK')+'<br><b>Tren Pekerjaan : </b>'+event.feature.getProperty('PEKERJAAN')+'<br><b>Rata-rata Penghasilan : </b>'+event.feature.getProperty('PENGHASILAN');
infowindow.setContent(infowindowcontent);
infowindow.setPosition(event.latLng);
infowindow.open(map);
});
}
function showError(err) {
console.log(err);
}
function initMap(){
map = new google.maps.Map(document.getElementById('map'),{
zoom:5,
center:center,
maxZoom: 7,
minZoom: 5,
});
infowindow = new google.maps.InfoWindow();
}
</script>
</body>
</html>