Update attribution when background layer changes

This commit is contained in:
Ansis Brammanis
2013-01-08 12:21:38 -05:00
parent cf5910d991
commit 1e12062f16
2 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -217,7 +217,7 @@ window.iD = function(container) {
.attr('class','pad1 fillD about-block link-list')
.html("<li><a target='_blank' href='http://github.com/systemed/iD'>view code</a></li> " +
"<li><a target='_blank' href='http://github.com/systemed/iD/issues'>report a bug</a></li>" +
" <li>imagery <a target='_blank' href='http://opengeodata.org/microsoft-imagery-details'>provided by bing</a></li>");
" <li id='attribution'>imagery <a target='_blank' href='http://opengeodata.org/microsoft-imagery-details'>provided by bing</a></li>");
var contributors = about.append('div')
.attr('id', 'user-list')
+9 -3
View File
@@ -3,7 +3,8 @@ iD.layerswitcher = function(map) {
sources = [{
name: 'Bing',
source: iD.BackgroundSource.Bing,
description: 'Satellite imagery.'
description: 'Satellite imagery.',
link: 'http://opengeodata.org/microsoft-imagery-details'
}, {
name: 'TIGER 2012',
source: iD.BackgroundSource.Tiger2012,
@@ -11,11 +12,13 @@ iD.layerswitcher = function(map) {
}, {
name: 'OSM',
source: iD.BackgroundSource.OSM,
description: 'The default OpenStreetMap layer.'
description: 'The default OpenStreetMap layer.',
link: 'http://www.openstreetmap.org/'
}, {
name: 'MapBox',
source: iD.BackgroundSource.MapBox,
description: 'Satellite and Aerial Imagery'
description: 'Satellite and Aerial Imagery',
link: 'http://mapbox.com'
}, {
name: 'Custom',
source: iD.BackgroundSource.Custom,
@@ -92,6 +95,9 @@ iD.layerswitcher = function(map) {
.classed('selected', function(d) {
return d.source === map.background.source();
});
d3.select('#attribution a')
.attr('href', d.link)
.text('provided by ' + d.name);
}
content