-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
executable file
·99 lines (91 loc) · 4.18 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Auckland CCTV Network</title>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-142834572-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-142834572-1');
</script>
<!-- Open Street Map -->
<link rel="stylesheet" href="https://openlayers.org/en/v4.6.5/css/ol.css" type="text/css">
<script src="https://openlayers.org/en/v4.6.5/build/ol.js" type="text/javascript"></script>
<script>
var map;
var mapLat = -36.8513;
var mapLng = 174.7644;
var mapDefaultZoom = 11;
function initialize_map() {
map = new ol.Map({
target: "map",
layers: [
new ol.layer.Tile({
source: new ol.source.OSM({
url: "https://a.tile.openstreetmap.org/{z}/{x}/{y}.png"
})
})
],
view: new ol.View({
center: ol.proj.fromLonLat([mapLng, mapLat]),
zoom: mapDefaultZoom
})
});
}
function add_map_point(lat, lng) {
var vectorLayer = new ol.layer.Vector({
source:new ol.source.Vector({
features: [new ol.Feature({
geometry: new ol.geom.Point(ol.proj.transform([parseFloat(lng), parseFloat(lat)], 'EPSG:4326', 'EPSG:3857')),
})]
}),
style: new ol.style.Style({
image: new ol.style.Icon({
anchor: [0.5, 0.5],
anchorXUnits: "fraction",
anchorYUnits: "fraction",
src: "https://upload.wikimedia.org/wikipedia/commons/e/ec/RedDot.svg"
})
})
});
map.addLayer(vectorLayer);
}
var req = new XMLHttpRequest();
req.open("GET", "https://raw.githubusercontent.com/PaulAtKeyboard/OpenCCTV/master/data-AT-CCTV.json", false);
req.send();
var data = JSON.parse(req.responseText);
console.log(data[0]);
function make_map() {
for (rows of data) {
add_map_point(rows["Lattitude"], rows["Longitude"]);
}
}
</script>
<style type="text/css"></style>
</head>
<body onload="initialize_map(); make_map();">
<div id="map" style="position: absolute; width: 100vw; height: 100vh; left: 0; top: 0"></div>
<!--
<div style="position: absolute; width: 50vw; height: 100vh; right: 0; top: 0; background-color: #222; color: #efefef; font-family: sans-serif; line-height: 10vh; text-align: center; font-size: 42pt;">Public Security Cameras around Auckland</div>
-->
</body>
</html>
<!--
## Disclaimer
### This Project is just for fun.
* AUTHORS MAKE NO GUARANTEE OF VALIDITY
* PLEASE BE AWARE THAT ANY INFORMATION YOU MAY FIND MAY BE INACCURATE, MISLEADING, DANGEROUS, ADDICTIVE, UNETHICAL.
* DO NOT RELY UPON ANY INFORMATION FOUND WITHOUT INDEPENDENT VERIFICATION.
* Information on this website has been derived from various sources.
* All information should be considered as being illustrative and indicative only. Your use of information from this website is entirely at your own risk.
* Authors does not give and expressly disclaims any warranty as to the accuracy or completeness of the information or its fitness for any purpose.
* Auckland Council accepts no liability for any error, omission, or inaccuracy of the information or from any use of or reliance on the information provided.
* You should independently verify the accuracy of any information before taking any action in reliance upon it.
* You waive and release Authors of this Project from any claims arising from your use of this website or the information provided by it.
* You indemnify Authors of this Project against all claims, loss or damages arising in connection with your use of the information provided.
* Information from this Project may not be used for the purposes of any legal disputes.
-->