-
Notifications
You must be signed in to change notification settings - Fork 9
/
map.html
85 lines (74 loc) · 3.01 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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>OpenWiFiMap</title>
<link rel="stylesheet" href="https://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" />
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.6.2/leaflet.min.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.6.2/leaflet.ie.min.css" />
<![endif]-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.6.2/leaflet.js"></script>
<link rel="stylesheet" href="external/leaflet-markercluster/MarkerCluster.css" />
<link rel="stylesheet" href="external/leaflet-markercluster/MarkerCluster.Default.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="external/leaflet-markercluster/MarkerCluster.Default.ie.css" /><![endif]-->
<script src="external/leaflet-markercluster/leaflet.markercluster-src.js"></script>
<script src="external/leaflet/Bing.js"></script>
<!--leaflet end-->
<script src="external/icanhaz/ICanHaz.js"></script>
<script src="https://andrenarchy.github.io/couchmap/script/couchmap.js"></script>
<link rel="stylesheet" href="style/owm_widget.css" />
<script src="script/owm_widget.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><!--target-densitydpi=device-dpi-->
</head>
<body style="margin: 0; margin: 0;">
<script id="mappopupmust" type="text/html">
<a href="index.html#detail?node={{id}}" class="ui-btn ui-shadow ui-btn-corner-all ui-btn-up-b">
<span class="ui-btn-inner ui-btn-corner-all">
<span class="ui-btn-text">{{hostname}}</span>
</span>
</a>
</script>
<div id="map" style="width: 100%; height: 100%;"></div>
<script>
function getPopupHTML(nodedata) {
return ich.mappopupmust(nodedata, true);
}
$(document).ready(function() {
var owmwidget = new OWMWidget(
{
getPopupHTML: getPopupHTML,
onBboxChange: function(bbox) {
window.location.hash = 'bbox='+bbox.toString();
}
},
{},
{
couchUrl: 'api/',
coarseThreshold: 1000
}
);
function onResize() {
$("#map").height( $(window).height() );
owmwidget.map.invalidateSize();
}
$(window).resize( onResize );
onResize();
// determine bounding box from hash
var hash = window.location.hash;
var bbox = null;
if (hash.search(/#bbox=/)!=-1) {
bbox = getBboxFromString(hash.replace(/#bbox=/, ""));
}
// set location
if (bbox) {
owmwidget.fitBbox(bbox);
} else {
owmwidget.map.locate({setView: true, maxZoom: 15})
.on('locationerror', function(e) {console.log(e.message)});
}
});
</script>
</body>
</html>