-
Notifications
You must be signed in to change notification settings - Fork 9
/
map.html
52 lines (44 loc) · 1.57 KB
/
map.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
<!DOCTYPE html>
<html>
<head>
<title>DHIS 2 GIS</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<style>
body { padding: 0; margin: 0; }
html, body, #map { height: 100%; }
#map { overflow: hidden; }
#map .dhis2-map-title { display: none; }
#map .leaflet-container { height: 100%; box-sizing: border-box; }
#map .leaflet-control-zoom { display: none; }
#map .leaflet-control-legend-toggle { display: none; }
#map .leaflet-control-legend-content { display: block; padding: 10px 10px 0 10px; }
</style>
</head>
<body>
<div id="map"></div>
<script src="extjs/ext-all.js"></script>
<script src="map.js"></script> <!-- transpiled -->
<script>
var getURLParameter = function(name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null;
}
var mapId = getURLParameter('id');
Ext.onReady(function() {
if (mapId) {
GIS.plugin.getMap({
url: 'http://localhost:8080',
el: 'map',
id: mapId,
crossDomain: true,
username: 'admin',
password: 'district',
onReady: function() {
console.log('map is ready!');
}
});
}
});
</script>
</body>
</html>