Skip to content

Commit

Permalink
Some further tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
afoeder committed Jun 11, 2024
1 parent ce16d08 commit b850ed6
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions amex-dining-credit/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<body>
<header style="display: flex; gap: 2rem; align-items: baseline">
<h1>AMEX Dining Credit restaurants</h1>
<h1>AMEX Dining Credit restaurants <small style="font-size: x-small">beta</small></h1>

<nav>
<select id="country-chooser">
Expand Down Expand Up @@ -93,7 +93,7 @@ <h1>AMEX Dining Credit restaurants</h1>

map = new Map(document.getElementById("map"), {
center: { lat: 51.163375, lng: 10.447683 },
zoom: 6,
zoom: 2,
mapId: "DEMO_MAP_ID"
});
}
Expand All @@ -118,16 +118,17 @@ <h1>AMEX Dining Credit restaurants</h1>
}
console.info("merchants for "+country+":", merchantsJson);

merchantsJson.forEach(item => {
merchantsJson.forEach((item, i) => {
if (!item.assumedLocation) {
console.warn("Could not find a location for", item);
return;
}
new AdvancedMarkerElement({
map,
position: { lat: item.assumedLocation.lat, lng: item.assumedLocation.lon },
title: item.name,
});
const marker =
new AdvancedMarkerElement({
map,
position: { lat: item.assumedLocation.lat, lng: item.assumedLocation.lon },
title: item.name,
});
});
}

Expand All @@ -138,14 +139,16 @@ <h1>AMEX Dining Credit restaurants</h1>
fillMarkers(select.value);

const selectedOption = select.options[select.selectedIndex];
//@setZoom https://developers.google.com/maps/documentation/javascript/reference/map
map.panTo({lat: parseFloat(selectedOption.dataset.lat), lng: parseFloat(selectedOption.dataset.lng)});
map.setZoom(6);
});

}();
</script>

<footer style="margin-top: 1rem">
Source:
AMEX home page:
<a href="https://www.americanexpress.com/en-gb/benefits/diningbenefit/">🇬🇧</a>
<a href="https://www.americanexpress.com/de-de/benefits/diningbenefit/">🇩🇪</a>
</footer>
Expand Down

0 comments on commit b850ed6

Please sign in to comment.