2
0

location_page.html 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. {% extends "base.html" %}
  2. {% load wagtailimages_tags %}
  3. {% block head-extra %}
  4. <style>
  5. /* Needed for Google map embed */
  6. #map {
  7. height: 100%;
  8. }
  9. .maps.embed-container {
  10. pointer-events: none;
  11. }
  12. html, body {
  13. height: 100%;
  14. margin: 0;
  15. padding: 0;
  16. }
  17. </style>
  18. {% endblock head-extra %}
  19. {% block content-header %}
  20. <h1>{{ page.title }}</h1>
  21. <figure>
  22. {% image self.image fill-600x600 %}
  23. </figure>
  24. {% endblock content-header %}
  25. {% block content-body %}
  26. <p>{{ page.address|linebreaks }}</p>
  27. <div id="map" class="maps embed-container"></div>
  28. {% for hours in page.opening_hours %}
  29. <li>{{ hours }}</li>
  30. {% endfor %}
  31. <script>
  32. var map;
  33. function initMap() {
  34. map = new google.maps.Map(document.getElementById('map'), {
  35. center: {
  36. lat: {{lat}},
  37. lng: {{long}}
  38. },
  39. zoom: 8
  40. });
  41. var marker = new google.maps.Marker({
  42. position: {
  43. lat: {{lat}},
  44. lng: {{long}}
  45. },
  46. map: map,
  47. title: '{{page.title}}'
  48. });
  49. }
  50. </script>
  51. <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyD31CT9P9KxvNUJOwDq2kcFEIG8ADgaFgw&callback=initMap" async defer></script>
  52. {% endblock content-body %}