Advertisement
Guest User

Untitled

a guest
Mar 7th, 2023
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.26 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Google Maps Api</title>
  8. <script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>
  9. <link href="style.css" rel="stylesheet">
  10. <link href="loadbar.css" rel="stylesheet">
  11. </head>
  12.  
  13. <body>
  14. <div id="map"></div>
  15.  
  16. <style type="text/css">
  17. body {
  18. overflow: hidden;
  19. }
  20. </style>
  21.  
  22. <style>#map
  23. {
  24. width: 150px;
  25. height:90px;
  26. margin: 0;
  27. position: absolute;
  28. top: 50%;
  29. left: 50%;
  30. margin-right: -50%;
  31. transform: translate(-50%, -50%)
  32. }
  33.  
  34. #map.fullscreen {
  35. position: fixed;
  36. width:100%;
  37. height: 100%;
  38. }</style>
  39.  
  40. <script
  41. src="https://maps.googleapis.com/maps/api/js?key=&callback=initMap&v=weekly&language=he"
  42. defer
  43. ></script>
  44.  
  45. <script>let map;
  46.  
  47. function initMap() {
  48. // The location of Uluru
  49. const uluru = { lat: 32.1582615544072, lng: 34.89155037133181 };
  50. // The map, centered at Uluru
  51. map = new google.maps.Map(document.getElementById("map"), {
  52. zoom: 11,
  53. center: uluru,
  54. disableDefaultUI: true,
  55. fullscreenControl: true,
  56.  
  57. options: {
  58. gestureHandling: 'greedy'
  59. }
  60. });
  61.  
  62.  
  63. // Create the DIV to hold the control.
  64. const centerControlDiv = document.createElement("div");
  65. // Create the control.
  66. const centerControl = createCenterControl(map);
  67. // Append the control to the DIV.
  68. centerControlDiv.appendChild(centerControl);
  69. map.controls[google.maps.ControlPosition.TOP_RIGHT].push(centerControlDiv);
  70.  
  71. const chicago = { lat: 41.85, lng: -87.65 };
  72.  
  73. /**
  74. * Creates a control that recenters the map on Chicago.
  75. */
  76. function createCenterControl(map) {
  77. const controlButton = document.createElement("button");
  78.  
  79. // Set CSS for the control.
  80. controlButton.style.backgroundColor = "#fff";
  81. controlButton.style.border = "2px solid #fff";
  82. controlButton.style.borderRadius = "3px";
  83. controlButton.style.boxShadow = "0 2px 6px rgba(0,0,0,.3)";
  84. controlButton.style.color = "rgb(25,25,25)";
  85. controlButton.style.cursor = "pointer";
  86. controlButton.style.fontFamily = "Roboto,Arial,sans-serif";
  87. controlButton.style.fontSize = "16px";
  88. controlButton.style.lineHeight = "28px";
  89. controlButton.style.borderLeftWidth = "8px";
  90. controlButton.style.margin = "8px 8px 22px 0";
  91. controlButton.style.padding = "0 5px";
  92. controlButton.style.textAlign = "center";
  93. controlButton.textContent = "Center Map";
  94. controlButton.title = "Click to recenter the map";
  95. controlButton.type = "button";
  96.  
  97. // Setup the click event listeners: simply set the map to Chicago.
  98. controlButton.addEventListener("click", () => {
  99. map.setCenter(chicago);
  100. });
  101. return controlButton;
  102. }
  103.  
  104. const rectangle = new google.maps.Rectangle({
  105. strokeColor: "#FF0000",
  106. strokeOpacity: 0.8,
  107. strokeWeight: 2,
  108. fillColor: "#FF0000",
  109. fillOpacity: 0.35,
  110. map,
  111. bounds: {
  112. north: uluru.lat - 0.005,
  113. south: uluru.lat + 0.005,
  114. west: uluru.lng - 0.005,
  115. east: uluru.lng + 0.005,
  116. },
  117. });
  118.  
  119. }
  120.  
  121. window.initMap = initMap;</script>
  122. </body>
  123.  
  124.  
  125.  
  126. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  127. <script src="loadbar.js" type="text/javascript"></script>
  128. <div class='progress' id="progress_div">
  129.  
  130.  
  131. <h1 id="loading-message">...טוען מפה</h1>
  132. <div class='bar' id='bar1'></div>
  133. <div class='percent' id='percent1'></div>
  134. </div>
  135.  
  136. <div i
  137. <div id="content">
  138.  
  139.  
  140. </div>
  141. </div>
  142.  
  143. <input type="hidden" id="progress_width" value="0">
  144. <div>
  145.  
  146. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement