Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update main.js
  • Loading branch information
JunaTeresMartin authored Oct 29, 2023
commit 735e7631e3411646d4b87eb28dd643c65721660a
22 changes: 15 additions & 7 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
let map;

async function initMap() {
// The location of Uluru
const position = { lat: -25.344, lng: 131.031 };
// Create an array of Indian Coffee House locations
const indianCoffeeHouses = [
{ lat: 10.152691403374137, lng: 76.73782588446456, name: "Indian Coffee House 1" },
{ lat: 10.18062367564776, lng: 76.4350655114152, name: "Indian Coffee House 2" },
{ lat: 9.950490304914442, lng: 76.63755310505263, name: "Indian Coffee House 3" },
{ lat: 10.032395545432703, lng: 76.36337757752591, name: "Indian Coffee House 4" },
];
// Request needed libraries.
//@ts-ignore
const { Map } = await google.maps.importLibrary("maps");
Expand All @@ -29,11 +34,14 @@ async function initMap() {
styles: darkModeStyle,
});

// The marker, positioned at Uluru
const marker = new AdvancedMarkerElement({
map: map,
position: position,
title: "Uluru",

// Add markers for Indian Coffee Houses
indianCoffeeHouses.forEach(place => {
new AdvancedMarkerElement({
map: map,
position: place,
title: place.name,
});
});
}

Expand Down