Show icons from the editor-layer-index, remove old Bing icon

This commit is contained in:
Bryan Housel
2017-06-16 12:04:54 -04:00
parent 87b17a2fbb
commit 8f6bd5fb14
7 changed files with 2022 additions and 1799 deletions
+21 -13
View File
@@ -33,24 +33,32 @@ export function uiAttribution(context) {
return;
}
var source = t('imagery.' + d.id + '.attribution.text',
var selection;
if (d.terms_url) {
selection = d3.select(this)
.append('a')
.attr('href', d.terms_url)
.attr('target', '_blank');
} else {
selection = d3.select(this);
}
var terms_text = t('imagery.' + d.id + '.attribution.text',
{ default: d.terms_text || d.id || d.name() }
);
if (d.logo) {
source = '<img class="source-image" src="' + context.imagePath(d.logo) + '">';
if (d.icon && !d.overlay) {
selection
.append('img')
.attr('class', 'source-image')
.attr('src', d.icon);
}
if (d.terms_url) {
d3.select(this)
.append('a')
.attr('href', d.terms_url)
.attr('target', '_blank')
.html(source);
} else {
d3.select(this)
.text(source);
}
selection
.append('span')
.attr('class', 'attribution-text')
.text(terms_text);
})
.merge(background);