-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcarte-heatmap.php
164 lines (133 loc) · 5.33 KB
/
carte-heatmap.php
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!DOCTYPE html>
<html lang="fr">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-113973828-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-113973828-2');
</script>
<title>Velib Paris - Carte officieuse - Heat Map des mouvements</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="Carte officieuse des stations du nouveau velib 2018: stations qui fonctionnent ou peut être pas, nombre de velos et VAE disponibles..." />
<meta name="keywords" content="velib, velib 2018, velib2018, velib 2, cartes, geolocalisation, gps, autour de moi, station, vélo, paris, fonctionnent, disponibles, HS, en panne" />
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
<meta name="robots" content="index, follow">
<link rel="canonical" href="https://velib.philibert.info/carte-heatmap.php" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#00a300">
<meta name="msapplication-TileImage" content="/mstile-144x144.png">
<meta name="theme-color" content="#ffffff">
<link rel="stylesheet" media="all" href="./css/joujouVelib.css?<?php echo filemtime('./css/joujouVelib.css');?>">
<script src="./inc/mapLeaflet.js?<?php echo filemtime('./inc/mapLeaflet.js');?>" type="text/javascript"></script>
<!-- Base MAP -->
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
crossorigin=""/>
<!-- Make sure you put this AFTER Leaflet's CSS -->
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="
crossorigin=""></script>
<!-- Base MAP END-->
<!-- full screen-->
<script src='https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/Leaflet.fullscreen.min.js'></script>
<link href='https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/leaflet.fullscreen.css' rel='stylesheet' />
<!-- full screen END-->
<!-- custom controle -- refresh and toggle button -->
<script src="./inc/Leaflet.Control.Custom.js"></script>
<!-- custom controle -- END -->
<!-- heatmap -->
<script src="./inc/leaflet-heat.js"></script>
<!-- heatmap -- END -->
</head>
<body>
<?php
include "./inc/mysql.inc.php";
$lofFile='./.maintenance';
if(file_exists ($lofFile) )
{
echo
"
<div class='maintenance'>
<!-- !!! Mode maintenance actif !!! -->
Plus de collecte de données depuis le 11/03/2022 17:22</br>
</div>
";
}
include "./inc/menu.inc.php";
?>
<div id="mapid"></div>
<script type="text/javascript">
var locations = [];
var marker, i, iconurl;
var markers = [];
var HS;
var mvtDate = 0;
var zoomp = 13;
var latp = 48.86;
var lonp = 2.34;
// initiate leaflet map
var mymap = L.map('mapid', {
center: [latp, lonp],
zoom: zoomp,
zoomControl: false
})
// add zoomControl
L.control.zoom({ position: 'topright' }).addTo(mymap);
// add full screen control
mymap.addControl(new L.Control.Fullscreen());
// set map area limits
var southWest = L.latLng(48.74, 2.14),
northEast = L.latLng( 48.98, 2.55),
mybounds = L.latLngBounds(southWest, northEast);
mymap.setMaxBounds(mybounds);
mymap.options.minZoom = 11;
mymap.options.maxBoundsViscosity = 1.0;
//Load tiles
L.tileLayer('https://velib.philibert.info/tiles/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(mymap);
//load stations to the map
getHeatmapData(mvtDate);
// slider management
var cc2 = L.control.custom({
position: 'bottomleft',
title: 'switch',
content :
'<div class="value">Aujourd\'hui</div><input type="range" min="0" max="10" step="1" value="0">',
style :
{
padding: '0px',
}
})
.addTo(mymap);
var elem = document.querySelector('input[type="range"]');
var rangeValue = debounce(function(){
var newValue = elem.value;
mvtDate = newValue;
getHeatmapData(mvtDate);
if(elem.value==0)
newValue = "Aujourd'hui";
else if(elem.value==1)
newValue = "Hier";
else newValue = "J-"+newValue;
var target = document.querySelector('.value');
target.innerHTML = newValue;
},300);
elem.addEventListener("input", rangeValue);
</script>
<div class="disclaimer">
Estimation de la densité de mouvements des velibs basée sur le nombre de retraits identifiés pour chaque station.
<b>Ce site n'est pas un site officiel de vélib.</b> Les données utilisées proviennent de <a href="www.velib-metropole.fr">www.velib-metropole.fr</a> et appartiennent à leur propriétaire.
</div>
<div id="mypub">
<iframe id="gads" src="./inc/ads.inc.html" width="100%" height="600px" />
</div>
</body>
</html>