Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
final changes
Browse files Browse the repository at this point in the history
  • Loading branch information
webbgamers committed Sep 17, 2023
1 parent de65632 commit 05b2a07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<head>
<title>Geolocation</title>
<title>Nearus.xyz</title>
<script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>

<link rel="stylesheet" type="text/css" href="./style.css" />
Expand All @@ -11,7 +11,7 @@
<div id="map"></div>
<div id="sidebar">
</div>
<script class="map"
<script
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCuphXtdflZ-EgMzjRYEnGACxL7RQxFqJ4&callback=initMap&v=weekly"
defer
></script>
Expand Down
16 changes: 3 additions & 13 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async function initMap() {
zoom: 12,
mapId: "MAPMAP"
});
infoWindow = new google.maps.InfoWindow();
//infoWindow = new google.maps.InfoWindow();

const locationButton = document.createElement("button");

Expand All @@ -37,12 +37,12 @@ async function initMap() {
map.setCenter(pos);
},
() => {
handleLocationError(true, infoWindow, map.getCenter());

},
);
} else {
// Browser doesn't support Geolocation
handleLocationError(false, infoWindow, map.getCenter());
//handleLocationError(false, infoWindow, map.getCenter());
}
});
var response = await fetch("https://discount-hub-api-ftp53nna7a-uc.a.run.app/nearby?loc=25.9107681%20-80.1418737&r=100000");
Expand Down Expand Up @@ -84,16 +84,6 @@ async function initMap() {

}

function handleLocationError(browserHasGeolocation, infoWindow, pos) {
infoWindow.setPosition(pos);
infoWindow.setContent(
browserHasGeolocation
? "Error: The Geolocation service failed."
: "Error: Your browser doesn't support geolocation.",
);
infoWindow.open(map);
}

window.initMap = initMap;


0 comments on commit 05b2a07

Please sign in to comment.