map.html 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. {% extends "base_template.html" %}
  2. {% block head %}
  3. <!-- my css -->
  4. <link rel="stylesheet" type="text/css" href="/static/map.css">
  5. <!-- leaflet css -->
  6. <link rel="stylesheet" href="https://unpkg.com/leaflet@1.4.0/dist/leaflet.css"
  7. integrity="sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA=="
  8. crossorigin=""/>
  9. <script src='https://api.mapbox.com/mapbox-gl-js/v2.1.1/mapbox-gl.js'></script>
  10. <link href='https://api.mapbox.com/mapbox-gl-js/v2.1.1/mapbox-gl.css' rel='stylesheet' />
  11. <!-- leaflet js -->
  12. <script src="https://unpkg.com/leaflet@1.4.0/dist/leaflet.js"
  13. integrity="sha512-QVftwZFqvtRNi0ZyCtsznlKSWOStnDORoefr1enyq5mVL4tmKB3S/EnC3rRJcxCPavG10IcrVGSmPh6Qw5lwrg=="
  14. crossorigin=""></script>
  15. {% endblock %}
  16. {% block body %}
  17. <div id="mapid">
  18. </div>
  19. <!-- my js -->
  20. <script src="/static/js/map.js"></script>
  21. {% for town in towns %}
  22. <script type="text/javascript">addPin("{{town|safe}}")</script>
  23. {% endfor %}
  24. <script type="text/javascript">
  25. resizePins();
  26. recenterMap();
  27. </script>
  28. <div id="mapstops"><a href="stops">See the Stops.</a></div>
  29. {% endblock %}