forked from TheRadialActive/mietmap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
85 lines (74 loc) · 3.8 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Mietpreise In Karlsruhe</title>
<meta name="viewport" content="initial-scale=1,width=device-width">
<link rel="stylesheet" href="libs/Leaflet-0.7.3/leaflet.css"/>
<link rel="stylesheet" href="libs/Leaflet.label/leaflet.label.css"/>
<link rel="stylesheet" href="libs/style.css"/>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"/>
<link rel="stylesheet" href="libs/Leaflet.zoomhome/leaflet.zoomhome.css"/>
<script src="libs/jquery-1.11.2.min.js"></script>
<script>
// Force canvas display, much faster when displaying a lot of
// circle markers. See
// http://leafletjs.com/reference.html#path-canvas
var L_PREFER_CANVAS = true;
</script>
<script src="libs/Leaflet-0.7.3/leaflet.js"></script>
<script src="libs/Leaflet.label/leaflet.label.js"></script>
<script src="libs/Leaflet.zoomhome/leaflet.zoomhome.min.js"></script>
<script src="libs/colormap.js"></script>
<script src="libs/mietmap.js"></script>
<script>
var appConfig, LAT, LON, MIN_RENT, MAX_RENT, CITY = 0;
$.getJSON('./config.json', function(data) {
appConfig = data;
LAT = parseFloat(appConfig['lat']);
LON = parseFloat(appConfig['lon']);
MIN_RENT = appConfig['min_rent'];
MAX_RENT = appConfig['max_rent'];
CITY = appConfig['city'];
});
var TILES_URL = 'http://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png';
var INITIAL_LOCATION = 0;
// var INITIAL_LOCATION = [49.0140679, 8.4044366];
var INITIAL_ZOOM = 13;
var MAX_ZOOM = 16;
var MIN_ZOOM = 11;
var ATTRIBUTION = 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> ' +
'contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">' +
'CC-BY-SA</a>. Tiles © <a href="http://cartodb.com/attributions">' +
'CartoDB</a>';
var OVERLAY_URL = 'overlay.png';
var OVERLAY_BOUNDS = 0;
// var OVERLAY_BOUNDS = [[48.92, 8.28], [49.08, 8.53]];
var OVERLAY_OPTIONS = {opacity: 0.75};
var CIRCLE_RADIUS = 3;
var CIRCLE_OPTIONS = {color: '#000', weight: 1, fillOpacity: 1};
var RENT_URL = 0;
var RENT_SPAN = 0;
$(document).ready(function() {
INITIAL_LOCATION = [LAT, LON];
OVERLAY_BOUNDS = [[(INITIAL_LOCATION[0]-0.0940679),(INITIAL_LOCATION[1]-0.1254366)], [(INITIAL_LOCATION[0]+0.0659321),(INITIAL_LOCATION[1]+0.125563)]];
RENT_URL = 'scraper/export/markers.json';
RENT_SPAN = MAX_RENT - MIN_RENT;
initMap();
initLegend();
});
</script>
</head>
<body>
<div id="map"></div>
<div id="legend">
<h1 id="city"></h1>
<div id="scale">
<div id="colorbar"></div>
<span id="min-rent"></span><span id="max-rent"></span>
</div>
<p>Ein Projekt des <a href="http://codefor.de/karlsruhe">Open Knowledge Lab Karlsruhe</a>, basierend auf den Kaltmieten aus Anzeigen von <a href="https://www.immobilienscout24.de">ImmobilienScout24</a>.</p>
<p>Quellcode: <a href="https://github.com/CodeforKarlsruhe/mietmap-scraper">Scraper</a>, <a href="https://github.com/CodeforKarlsruhe/mietmap-overlay">Heatmap</a>, <a href="https://github.com/CodeforKarlsruhe/mietmap">Karte</a>.</p>
</div>
</body>
</html>