-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
126 lines (98 loc) · 4.89 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
<html>
<head>
<title>Startups in Karlsruhe - Heatmap, Cluster und Links</title>
<!-- Favicon -->
<link rel="shortcut icon" href="img/logo_pg.png"/>
<meta charset="utf-8">
<!-- Twitter Card data -->
<meta name="twitter:card" value="Startups in Karlsruhe - Heatmap, Cluster und Links">
<!-- Open Graph data -->
<meta property="og:title" content="Startups in Karlsruhe - Heatmap, Cluster und Links" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://pioniergarage.github.io/startups-karlsruhe/" />
<meta property="og:image" content="https://pioniergarage.github.io/startups-karlsruhe/img/startups-in-karlsruhe.jpg" />
<meta property="og:description" content="Wolltest du schon immer entdecken, welche Startups es in Karlsruhe gibt und wo die Hotspots sind? Hier wirst du fündig!" />
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<!-- Leaflet -->
<link rel="stylesheet" href="js/leaflet/leaflet.css" />
<script src="js/leaflet/leaflet.js"></script>
<!-- MarkerCluster for Leaflet -->
<link rel="stylesheet" href="js/leaflet.markercluster/MarkerCluster.css" />
<link rel="stylesheet" href="js/leaflet.markercluster/MarkerCluster.Default.css" />
<script src="js/leaflet.markercluster/leaflet.markercluster-src.js"></script>
<!-- Heatmap -->
<script src="js/leaflet.heat/leaflet-heat.js"></script>
</head>
<body>
<div id="map" style="height: 100%"></div>
<div id="mymodal" class="modal fade" tabindex="100" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title"><img src="img/logo_pg.png" style="height: 25px"> Startups in Karlsruhe</h4>
</div>
<div class="modal-body">
<p>
Dies ist eine Visualisierung der Startups in Karlsruhe als Heatmap. Die Daten wurden bereitgestellt von <a href="http://startupska.de" target="_blank">StartUpsKA</a> mit freundlicher Genehmigung des <a href="http://cyberforum.de" target="_blank">CyberForum</a>.
</p>
<p>
Erstellt von Mitgliedern der <a href="http://pioniergarage.de" target="_blank">PionierGarage</a> und übrigens auch <a href="https://github.com/pioniergarage/startups-karlsruhe">auf GitHub</a>.
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Los geht's</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script type="text/javascript">
$( document ).ready(function() {
$('#mymodal').modal('show');
var coordinates_karlsruhe = [49.0, 8.4];
var map = L.map('map', {'layers': []}).setView(coordinates_karlsruhe, 13);
CartoDB_Positron = L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> © <a href="http://cartodb.com/attributions">CartoDB</a>',
subdomains: 'abcd',
maxZoom: 17
}).addTo(map);
var clusters = L.markerClusterGroup({
'singleMarkerMode': true, // 1-cluster instead of pointer
'maxClusterRadius': 150 // clusters have 150px radius -> larger clusters
});
var markers = L.layerGroup();
var heat = L.heatLayer([], {
minOpacity: 0.5, // cluster intensity -> size, area
radius: 50, // bigger dots -> area
blur: 75, // wider heat areas
max: 2 // avoids red dots for one single startup
}).addTo(map);
$.getJSON( "data.json", function( data ) {
for (var i = 0; i < data.length; i++) {
var location = data[i];
var geocode = location.geocode;
var coordinates = [geocode.latitude, geocode.longitude];
// markers (separate because of conflicts otherwise)
L.marker(coordinates)
.addTo(clusters);
L.marker(coordinates)
.addTo(markers);
// heat
heat.addLatLng(coordinates);
}
});
L.control.layers({
'Cluster': clusters,
'Heatmap': heat,
'Marker': markers
}, {}).addTo(map);
});
</script>
</body>
</html>