-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
134 lines (113 loc) · 3.74 KB
/
index.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<link rel="shortcut icon" href="/favicon.png" type="image/x-icon" />
<title>Sukey.io: Map</title>
<link rel="stylesheet" href="../css/master.css" type="text/css" media="screen" title="no title" charset="utf-8">
<script type="text/javascript" src="../js/jquery-1.4.4.js"></script>
<script type="text/javascript" src="../js/ticker-1.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
getTickerRSS();
});
</script>
<meta charset="utf-8" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://code.leafletjs.com/leaflet-0.3.1/leaflet.ie.css" />
<![endif]-->
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
<script src="geojson.js" type="text/javascript"></script>
</head>
<style>
body {
padding: 0;
margin: 0;
}
html, body, #map {
height: 100%;
}
</style>
</head>
<body>
<body onload="init()">
<div id="container" align="left">
<div id="ticker"></div>
</div>
<div id="sukey" onclick="location.href='http://sukey.org/io/webapp/';"></div>
<div id="map"></div>
<script>
var map = new L.Map('map');
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png',
cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution});
map.addLayer(cloudmade);
map.on('locationfound', onLocationFound);
map.on('locationerror', onLocationError);
map.locateAndSetView();
function onLocationFound(e) {
var radius = e.accuracy / 2;
var marker = new L.Marker(e.latlng);
map.addLayer(marker);
var circle = new L.Circle(e.latlng, radius);
map.addLayer(circle);
var WifiIcon = L.Icon.extend({
iconUrl: 'wifi.png',
shadowUrl: null,
iconSize: new L.Point(32, 37),
shadowSize: null,
iconAnchor: new L.Point(14, 37),
popupAnchor: new L.Point(2, -32)
});
var geojsonLayer = new L.GeoJSON(null, {
pointToLayer: function (latlng){
return new L.CircleMarker(latlng, {
radius: 8,
fillColor: "#ff7800",
color: "#000",
weight: 1,
opacity: 1,
fillOpacity: 0.8
});
}
});
var wifiJSON = new L.GeoJSON(fsWifi, {
pointToLayer: function (latlng){
return new L.Marker(latlng, {
icon: new WifiIcon()
});
}
});
geojsonLayer.on("featureparse", function (e) {
var popupContent = "";
if (e.geometryType == "Point") {
popupContent += "<p></p>";
}
if (e.properties && e.properties.popupContent) {
popupContent += e.properties.popupContent;
}
e.layer.bindPopup(popupContent);
if (e.properties && e.properties.style && e.layer.setStyle) {
e.layer.setStyle(e.properties.style);
}
});
wifiJSON.on("featureparse", function (e) {
var popupContent = "<p></p>";
popupContent += "<p></p>";
if (e.properties && e.properties.popupContent) {
popupContent += e.properties.popupContent;
}
e.layer.bindPopup(popupContent);
});
map.addLayer(wifiJSON);
wifiJSON.addGeoJSON(fsWifi);
wifiJSON.addGeoJSON(converted_json);
}
function onLocationError(e) {
alert(e.message);
}
</script>
</body>
</html>