Legend for GPS overlay layer

This commit is contained in:
John Firebaugh
2013-10-21 13:28:09 -07:00
parent a5311b5f6c
commit d2c8ea15fd
3 changed files with 10 additions and 0 deletions

View File

@@ -13959,6 +13959,7 @@
],
"terms_url": "http://www.openstreetmap.org/copyright",
"terms_text": "© OpenStreetMap contributors",
"terms_html": "© <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap contributors</a>. North: <span style='display: inline-block; width: 10px; height: 10px; background-color: #7fed11;'></span> South: <span style='display: inline-block; width: 10px; height: 10px; background-color: #7f11ed;'></span> East: <span style='display: inline-block; width: 10px; height: 10px; background-color: #ff3f3f;'></span> West: <span style='display: inline-block; width: 10px; height: 10px; background-color: #00bfbf;'></span>",
"overlay": true
},
{

View File

@@ -71,6 +71,9 @@ sources.forEach(function(source) {
if (attribution.text) {
im.terms_text = attribution.text;
}
if (attribution.html) {
im.terms_html = attribution.html;
}
['id', 'default', 'overlay'].forEach(function(a) {
if (source[a]) {

View File

@@ -16,6 +16,12 @@ iD.ui.Attribution = function(context) {
.append('span')
.attr('class', 'attribution')
.each(function(d) {
if (d.terms_html) {
d3.select(this)
.html(d.terms_html);
return;
}
var source = d.terms_text || d.id || d.name;
if (d.logo) {