-
Notifications
You must be signed in to change notification settings - Fork 0
/
maps.html
52 lines (38 loc) · 2.45 KB
/
maps.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
<!DOCTYPE html>
<html>
<head>
<title>Nos ombrieres</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/x-icon" href="docs/images/favicon.ico" />
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==" crossorigin=""/>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA==" crossorigin=""></script>
</head>
<body>
<div id="mapid" style="width: 600px; height: 400px;"></div>
<script>
function place() {
let place = Math.floor(Math.random() * 7)
return place;
}
var mymap = L.map('mapid').setView([43.610769,3.876716], 12);
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
maxZoom: 18,
attribution: 'Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, ' +
'Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
id: 'mapbox/streets-v11',
tileSize: 512,
zoomOffset: -1
}).addTo(mymap);
L.marker([43.57337648607997,3.9515458738433917]).addTo(mymap)
.bindPopup("<b>Station : Perol </b><br /> Places Total : 7 libre : "+ place() +" <br /> <img src='pexels-kindel-media-9800029.jpg' alt='image de station' height='150px' width='250'> ").openPopup();
L.marker([43.610884867751416,3.875861982070168]).addTo(mymap)
.bindPopup("<b>Station : Montpellier centre </b><br /> Places Total : 7 libre : "+ place() +" <br /> <img src='pexels-kindel-media-9800029.jpg' alt='image de station' height='150px' width='250'> ").openPopup();
L.marker([43.57570055577545,3.8267131840812763]).addTo(mymap)
.bindPopup("<b>Station : Saint-jean-de-Védas Mairie centre </b><br /> Places Total : 7 libre : "+ place() +" <br /> <img src='pexels-kindel-media-9800029.jpg' alt='image de station' height='150px' width='250'> ").openPopup();
L.marker([43.6041005,3.9191898]).addTo(mymap)
.bindPopup("<b>Station : odysseum </b><br /> Places Total : 7 libre : "+ place() +" <br /> <img src='pexels-kindel-media-9800029.jpg' alt='image de station' height='150px' width='250'> ").openPopup();
var popup = L.popup();
</script>
</body >
</html>