Skip to content

Commit

Permalink
Update map.js
Browse files Browse the repository at this point in the history
  • Loading branch information
CLADAU authored Apr 30, 2024
1 parent 01b748e commit 3767ab2
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions scripts/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,29 @@ $(window).on('load', function() {
}
}

/**
* Changes map attribution (author, GitHub repo, email etc.) in bottom-right
*/
function changeAttribution() {
var attributionHTML = $('.leaflet-control-attribution')[0].innerHTML;
var credit = 'View <a href="' + googleDocURL + '" target="_blank">data</a>';
var name = getSetting('_authorName');
var url = getSetting('_authorURL');

if (name && url) {
if (url.indexOf('@') > 0) { url = 'mailto:' + url; }
credit += ' by <a href="' + url + '">' + name + '</a> | ';
} else if (name) {
credit += ' by ' + name + ' | ';
} else {
credit += ' | ';
}

credit += 'View <a href="' + getSetting('_githubRepo') + '">code</a>';
if (getSetting('_codeCredit')) credit += ' by ' + getSetting('_codeCredit');
credit += ' with ';
$('.leaflet-control-attribution')[0].innerHTML = credit + attributionHTML;
}

/**
* Adds polylines to the map
Expand Down

0 comments on commit 3767ab2

Please sign in to comment.