index.html 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. {% extends "layout.html" %}
  2. {% block head %}
  3. {{ super() }}
  4. <!-- Leaflet JS -->
  5. <script src='https://api.tiles.mapbox.com/mapbox.js/v2.1.9/mapbox.js'></script>
  6. <!-- Leaflet CSS -->
  7. <link href='https://api.tiles.mapbox.com/mapbox.js/v2.1.9/mapbox.css' rel='stylesheet'/>
  8. <!-- Map style -->
  9. <style>
  10. #map {
  11. height: 600px;
  12. }
  13. </style>
  14. {% endblock %}
  15. {% block content %}
  16. <h1 class="ui header">{{ title }}</h1>
  17. {% if current_user.is_authenticated %}
  18. <h2 class="ui header">Hi {{ current_user.name }}!</h2>
  19. {% endif %}
  20. <div id="map"></div>
  21. <script type="text/javascript">
  22. L.mapbox.accessToken = 'pk.eyJ1IjoibGVtYXgiLCJhIjoidnNDV1kzNCJ9.iH26jLhEuimYd6vLOO6v1g';
  23. var map = L.mapbox.map('map', 'mapbox.outdoors', {
  24. maxZoom: 20,
  25. fullscreenControl: true,
  26. zoomControl: false
  27. })
  28. var layers = {
  29. "Basique": L.mapbox.tileLayer('mapbox.outdoors').addTo(map),
  30. "Lumineuse": L.mapbox.tileLayer('mapbox.light'),
  31. "Sombre": L.mapbox.tileLayer('mapbox.dark'),
  32. "Comics": L.mapbox.tileLayer('mapbox.comic'),
  33. "Crayon": L.mapbox.tileLayer('mapbox.pencil')
  34. }
  35. L.control.layers(
  36. layers,
  37. null,
  38. {position: 'topleft'}
  39. ).addTo(map);
  40. map.setView([48.8534100, 2.3488000], 13);
  41. </script>
  42. {% endblock %}