Skip to content

Commit

Permalink
Attribution
Browse files Browse the repository at this point in the history
  • Loading branch information
LOOHP committed Dec 18, 2024
1 parent 82b21a6 commit 60362a8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
10 changes: 9 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,19 @@ function toggleGradientPicker() {

function initMap() {
tileLayers.clearLayers();
map.attributionControl.setPrefix(false);
let first = true;
for (const basemapUrl of basemapUrls) {
if (first) {
L.tileLayer(basemapUrl.replace("{lang}", language === "en" ? "en" : "tc"), {
maxZoom: 19,
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a> &copy; <a href="https://api.portal.hkmapservice.gov.hk/disclaimer">HKSAR Gov</a>'
attribution: '' +
'<span class="logo-box"><img src="./one_bite_logo.png" alt="One Bite Design Studio" style="height: 40px;"></span>' +
'<span class="logo-box">Funded by <a href="https://www.onebitedesign.com">One Bite Design Studio</a></span>' +
`${attributionPrefix} | ` +
'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> ' +
'&copy; <a href="https://carto.com/attributions">CARTO</a> ' +
'&copy; <a href="https://api.portal.hkmapservice.gov.hk/disclaimer">HKSAR Gov</a>'
}).addTo(tileLayers);
first = false;
} else {
Expand Down Expand Up @@ -888,6 +895,7 @@ const redIcon = L.icon({
});

const map = L.map('map').setView([22.362458, 114.115333], 11);
const attributionPrefix = map.attributionControl.options.prefix;
const tileLayers = L.layerGroup().addTo(map);
initMap();

Expand Down
Binary file added one_bite_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,12 @@ html {
display: none !important;
}

.logo-box {
width: 100%;
display: block;
text-align: end;
}

@media screen and (max-width: 700px) {
.sidebar {
width: 100%;
Expand Down

0 comments on commit 60362a8

Please sign in to comment.