rodolpheg

Untitled

Feb 8th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. Avant les balises <body>, en HTML :
  2. <style>
  3. html, body {height: 100%; margin: 0;}
  4. #Carte { width: 100%; height: 100%; }
  5. </style>
  6.  
  7. Entre les balises <body>, en HTML :
  8. <div id='Carte'></div>
  9.  
  10. Entre les balises <script>, en JS. Remplacez 'VOTRE_CLÉ' par l'"ACCESS TOKEN" copiée ici : https://account.mapbox.com
  11. var maCarte = L.map('Carte');
  12. maCarte.setView([0,0], 2);
  13. var fondDeCarte = L.tileLayer(https://api.mapbox.com/styles/v1/mapbox/light-v10/tiles/{z}/{x}/{y}?access_token={accessToken}', {accessToken: 'VOTRE_CLÉ'}).addTo(maCarte)
Advertisement
Add Comment
Please, Sign In to add comment