lastposition.blade.php 1.2 KB

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