rodolpheg

Untitled

Feb 27th, 2020
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.  
  4. <head>
  5.  
  6.  
  7. <meta charset="utf-8" />
  8.  
  9. <title>Carte choroplèthe de revenu après impôt médian des ménages en 2015</title>
  10.  
  11. <!-- Chargement de la bibliothèque de programmation Leafletjs.com -->
  12. <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"/>
  13. <script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
  14. <!-- Chargement d'un plugin installé localement (qui nous sera utile pour charger des GeoJSON),
  15. télécharger ici : https://github.com/calvinmetcalf/leaflet-ajax et à copier dans un dossier 'plugins'
  16. créé pour l'occasion dans le même dossier que votre fichier index.html -->
  17. <script src="plugins/leaflet.ajax.min.js"></script>
  18.  
  19.  
  20. <style>
  21. html, body {height: 100%; margin: 0;}
  22. #map { width: 100%; height: 100%; }
  23.  
  24. .legend {
  25. text-align: left;
  26. line-height: 18px;
  27. color: #555;
  28. }
  29. .legend i {
  30. font: 12px Helvetica;
  31. width: 18px;
  32. height: 18px;
  33. float: left;
  34. margin-right: 6px;
  35. opacity: 0.7;
  36. }
  37. .info {
  38. padding: 16px 16px;
  39. font: 14px Helvetica;
  40. background: white;
  41. background: rgba(255,255,255,0.8);
  42. box-shadow: 0 0 15px rgba(0,0,0,0.2);
  43. border-radius: 5px;
  44. }
  45. .info h4 {
  46. margin: 0 0 5px; color: #777;
  47. }
  48.  
  49.  
  50. </style>
  51. </head>
  52.  
  53. <body>
  54.  
  55. <div id='map' class="row"></div>
  56.  
  57.  
  58. <script>
  59. // Initialisation d'une carte avec plusieurs fonds de plans
  60. mapboxUrl = 'https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoiZ2xldGFydGUiLCJhIjoiY2s2OGsydnFwMDV1NTNrbXhhYjJseHc2MiJ9.JIPCgdoi-OHpMtsp80YGqg';
  61. mapboxAttribution = 'Fond de carte &copy; <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>'
  62.  
  63. var light = L.tileLayer(mapboxUrl, {id: 'mapbox/light-v10', attribution: mapboxAttribution}),
  64. streets = L.tileLayer(mapboxUrl, {id: 'mapbox/streets-v11', attribution: mapboxAttribution}),
  65. sat = L.tileLayer(mapboxUrl, {id: 'mapbox/satellite-v9', attribution: mapboxAttribution}),
  66. gab = L.tileLayer(mapboxUrl, {id: 'gletarte/ck6p68ffj3nlw1ipfekx0126g', attribution: mapboxAttribution});
  67.  
  68. var map = L.map('map', {
  69. center: [45.52,-73.63],
  70. zoom: 13,
  71. layers: [sat, streets, light]
  72. });
  73. </script>
  74. </body>
  75.  
  76. </html>
Advertisement
Add Comment
Please, Sign In to add comment