Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <title>Carte choroplèthe de revenu après impôt médian des ménages en 2015</title>
- <!-- Chargement de la bibliothèque de programmation Leafletjs.com -->
- <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"/>
- <script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
- <!-- Chargement d'un plugin installé localement (qui nous sera utile pour charger des GeoJSON),
- télécharger ici : https://github.com/calvinmetcalf/leaflet-ajax et à copier dans un dossier 'plugins'
- créé pour l'occasion dans le même dossier que votre fichier index.html -->
- <script src="plugins/leaflet.ajax.min.js"></script>
- <style>
- html, body {height: 100%; margin: 0;}
- #map { width: 100%; height: 100%; }
- .legend {
- text-align: left;
- line-height: 18px;
- color: #555;
- }
- .legend i {
- font: 12px Helvetica;
- width: 18px;
- height: 18px;
- float: left;
- margin-right: 6px;
- opacity: 0.7;
- }
- .info {
- padding: 16px 16px;
- font: 14px Helvetica;
- background: white;
- background: rgba(255,255,255,0.8);
- box-shadow: 0 0 15px rgba(0,0,0,0.2);
- border-radius: 5px;
- }
- .info h4 {
- margin: 0 0 5px; color: #777;
- }
- </style>
- </head>
- <body>
- <div id='map' class="row"></div>
- <script>
- // Initialisation d'une carte avec plusieurs fonds de plans
- mapboxUrl = 'https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoiZ2xldGFydGUiLCJhIjoiY2s2OGsydnFwMDV1NTNrbXhhYjJseHc2MiJ9.JIPCgdoi-OHpMtsp80YGqg';
- mapboxAttribution = 'Fond de carte © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' + '<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + 'via © <a href="https://www.mapbox.com/">Mapbox</a>'
- var light = L.tileLayer(mapboxUrl, {id: 'mapbox/light-v10', attribution: mapboxAttribution}),
- streets = L.tileLayer(mapboxUrl, {id: 'mapbox/streets-v11', attribution: mapboxAttribution}),
- sat = L.tileLayer(mapboxUrl, {id: 'mapbox/satellite-v9', attribution: mapboxAttribution}),
- gab = L.tileLayer(mapboxUrl, {id: 'gletarte/ck6p68ffj3nlw1ipfekx0126g', attribution: mapboxAttribution});
- var map = L.map('map', {
- center: [45.52,-73.63],
- zoom: 13,
- layers: [sat, streets, light]
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment