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

View File

@@ -2718,11 +2718,17 @@ img.tile-removing {
content: '; ';
}
.source-image {
.attribution .source-image {
height: 20px;
vertical-align:top;
vertical-align: middle;
border-radius: 3px;
}
.attribution span {
margin: 0 5px;
}
#footer {
pointer-events: all;
display: block;

File diff suppressed because one or more lines are too long

View File

@@ -54,9 +54,6 @@ sources.concat(whitelist).forEach(function(source) {
template: source.url
};
var description = source.description;
if (description) im.description = description;
var extent = source.extent || {};
if (extent.min_zoom || extent.max_zoom) {
im.scaleExtent = [
@@ -92,7 +89,7 @@ sources.concat(whitelist).forEach(function(source) {
im.terms_html = attribution.html;
}
['default', 'overlay', 'best'].forEach(function(a) {
['best', 'default', 'description', 'icon', 'overlay'].forEach(function(a) {
if (source[a]) {
im[a] = source[a];
}

BIN
dist/img/bing_maps.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

113
dist/locales/en.json vendored
View File

@@ -5112,30 +5112,119 @@
},
"imagery": {
"Bing": {
"description": "Satellite and aerial imagery.",
"name": "Bing aerial imagery"
},
"DigitalGlobe-Premium": {
"attribution": {
"text": "Terms & Feedback"
},
"description": "Premium DigitalGlobe satellite imagery.",
"name": "DigitalGlobe Premium Imagery"
},
"DigitalGlobe-Standard": {
"attribution": {
"text": "Terms & Feedback"
},
"description": "Standard DigitalGlobe satellite imagery.",
"name": "DigitalGlobe Standard Imagery"
},
"MAPNIK": {
"attribution": {
"text": "© OpenStreetMap contributors, CC-BY-SA"
},
"description": "The default OpenStreetMap layer.",
"name": "OpenStreetMap (Standard)"
},
"Mapbox": {
"attribution": {
"text": "Terms & Feedback"
},
"description": "Satellite and aerial imagery.",
"name": "Mapbox Satellite"
},
"New_and_Misaligned_TIGER_Roads-2013": {
"description": "At zoom level 16+, public domain map data from the US Census. At lower zooms, only changes since 2006 minus changes already incorporated into OpenStreetMap",
"name": "New & Misaligned TIGER Roads"
},
"OSM_Inspector-Addresses": {
"attribution": {
"text": "© Geofabrik GmbH, OpenStreetMap contributors, CC-BY-SA"
},
"name": "OSM Inspector: Addresses"
},
"OSM_Inspector-Geometry": {
"attribution": {
"text": "© Geofabrik GmbH, OpenStreetMap contributors, CC-BY-SA"
},
"name": "OSM Inspector: Geometry"
},
"OSM_Inspector-Highways": {
"attribution": {
"text": "© Geofabrik GmbH, OpenStreetMap contributors, CC-BY-SA"
},
"name": "OSM Inspector: Highways"
},
"OSM_Inspector-Multipolygon": {
"attribution": {
"text": "© Geofabrik GmbH, OpenStreetMap contributors, CC-BY-SA"
},
"name": "OSM Inspector: Area"
},
"OSM_Inspector-Places": {
"attribution": {
"text": "© Geofabrik GmbH, OpenStreetMap contributors, CC-BY-SA"
},
"name": "OSM Inspector: Places"
},
"OSM_Inspector-Routing": {
"attribution": {
"text": "© Geofabrik GmbH, OpenStreetMap contributors, CC-BY-SA"
},
"name": "OSM Inspector: Routing"
},
"OSM_Inspector-Tagging": {
"attribution": {
"text": "© Geofabrik GmbH, OpenStreetMap contributors, CC-BY-SA"
},
"name": "OSM Inspector: Tagging"
},
"Waymarked_Trails-Cycling": {
"attribution": {
"text": "© Sarah Hoffmann, CC by-SA 3.0, map data OpenStreetMap contributors, ODbL 1.0"
},
"name": "Waymarked Trails: Cycling"
},
"Waymarked_Trails-Hiking": {
"attribution": {
"text": "© Sarah Hoffmann, CC by-SA 3.0, map data OpenStreetMap contributors, ODbL 1.0"
},
"name": "Waymarked Trails: Hiking"
},
"Waymarked_Trails-MTB": {
"attribution": {
"text": "© Sarah Hoffmann, CC by-SA 3.0, map data OpenStreetMap contributors, ODbL 1.0"
},
"name": "Waymarked Trails: MTB"
},
"Waymarked_Trails-Skating": {
"attribution": {
"text": "© Sarah Hoffmann, CC by-SA 3.0, map data OpenStreetMap contributors, ODbL 1.0"
},
"name": "Waymarked Trails: Skating"
},
"Waymarked_Trails-Winter_Sports": {
"attribution": {
"text": "© Michael Spreng, CC by-SA 3.0, map data OpenStreetMap contributors, ODbL 1.0"
},
"name": "Waymarked Trails: Winter Sports"
},
"hike_n_bike": {
"attribution": {
"text": "© OpenStreetMap contributors"
},
"name": "Hike & Bike"
},
"mapbox_locator_overlay": {
"attribution": {
"text": "Terms & Feedback"
@@ -5143,6 +5232,12 @@
"description": "Shows major features to help orient you.",
"name": "Locator Overlay"
},
"openpt_map": {
"attribution": {
"text": "© OpenStreetMap contributors, CC-BY-SA"
},
"name": "OpenPT Map (overlay)"
},
"osm-gps": {
"attribution": {
"text": "© OpenStreetMap contributors"
@@ -5150,12 +5245,30 @@
"description": "Public GPS traces uploaded to OpenStreetMap.",
"name": "OpenStreetMap GPS traces"
},
"osm-mapnik-black_and_white": {
"attribution": {
"text": "© OpenStreetMap contributors, CC-BY-SA"
},
"name": "OpenStreetMap (Standard Black & White)"
},
"osm-mapnik-german_style": {
"attribution": {
"text": "© OpenStreetMap contributors, CC-BY-SA"
},
"name": "OpenStreetMap (German Style)"
},
"qa_no_address": {
"attribution": {
"text": "Simon Poole, Data ©OpenStreetMap contributors"
},
"name": "QA No Address"
},
"skobbler": {
"attribution": {
"text": "© Tiles: skobbler Map data: OpenStreetMap contributors"
},
"name": "skobbler"
},
"stamen-terrain-background": {
"attribution": {
"text": "Map tiles by Stamen Design, under CC BY 3.0"

View File

@@ -148,7 +148,6 @@ rendererBackgroundSource.Bing = function(data, dispatch) {
}).join(', ');
};
bing.logo = 'bing_maps.png';
bing.terms_url = 'https://blog.openstreetmap.org/2010/11/30/microsoft-imagery-details';
return bing;

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);