Post

Cartes-Leaflet-Php

Cartes-Leaflet-Php

Cartes-Leaflet-Php

PHP Leaflet

Utilisation leaflet dans un environnement PHP
Using PHP MySQL with Google Maps Alternative using the Leaflet library
https://github.com/Leaflet/Leaflet
http://leafletjs.com/

Dossier /var/www/webapp_yanspm/dev.ouestline.net_/cartographie/
Sous dossiers js et css
Télécharger les fichiers js et css Leaflet

1
2
3
4
5
6
7
8
9
10
11
12
13
.
├── css
│   └── leaflet.css
├── index.php
└── js
    ├── images
    │   ├── layers-2x.png
    │   ├── layers.png
    │   ├── marker-icon-2x.png
    │   ├── marker-icon.png
    │   └── marker-shadow.png
    ├── leaflet-src.js
    └── leaflet.js

Créer un fichier index.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!DOCTYPE html>
<html>
 <head>
  <title>Leaflet basic example</title>
  <link rel="stylesheet" href="css/leaflet.css" />
  <script src="js/leaflet.js"></script>
 </head>
 <body>
  <div id="map" style="width: 600px; height: 400px"></div>
  <script>
   var map = L.map('map').setView([51.505, -0.09], 13);
	L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
	    attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
	}).addTo(map);
  </script>
 </body>
</html>

Accès au site https://dev.ouestline.net/cartographie/

Cet article est sous licence CC BY 4.0 par l'auteur.