userdate.blade.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. @extends('calendar')
  2. @section('styles')
  3. <style>
  4. /* Always set the map height explicitly to define the size of the div
  5. * element that contains the map. */
  6. #map {
  7. height: 50%;
  8. }
  9. /* Optional: Makes the sample page fill the window. */
  10. html, body {
  11. height: 100%;
  12. margin: 0;
  13. padding: 0;
  14. }
  15. </style>
  16. </head>
  17. @endsection
  18. @section('map')
  19. <div id="map"></div>
  20. @endsection
  21. @section('scripts')
  22. <script>
  23. var map;
  24. function initMap() {
  25. map = new google.maps.Map(document.getElementById('map'), { /*
  26. center: {lat:{{ $dates }} , lng:{{ $dates }} },*/
  27. zoom: 15
  28. });
  29. var marker = new Array();
  30. @foreach ($dates as $data)
  31. map.setCenter({lat:{{ $data->lat }} , lng:{{ $data->lng }} });
  32. marker = new google.maps.Marker({
  33. map:map,
  34. position:{lat:{{ $data->lat }} , lng:{{ $data->lng }} }
  35. });
  36. @endforeach
  37. }
  38. </script>
  39. <ul>
  40. <li>
  41. </li>
  42. </ul>
  43. <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB8gUrKIK6UryDcJOEZD9V3fxpdDk8s4Lo&callback=initMap"
  44. async defer></script>
  45. @endsection