Show bg=photo apart from bg=satellite, on the service's layers

The operator, after seeing real posters: EOX's 2016 mosaic is rejected, and a layout's Commons
photo now serves only an explicit bg=photo, which falls back to what bg=satellite draws. The
picker therefore puts the satellite-or-map choice first, per layout, on the layers the service
uses (PDOK HR, IGN's frozen BD ORTHO 2021-2023, USGS, EOxCloudless 2025), and offers the photos
as optional for bg=photo. One picks entry may carry a photo, "use": "map", or both, and each
choice keeps the other half. The builder and the posters page offer bg=photo; width starts at
400; the licences page sets the options in "used for" as code.

Claude-Session: https://claude.ai/code/session_01NcbgfJAa38xFpzy69BWrqh
This commit is contained in:
2026-11-27 15:20:09 +01:00
parent 4a9bd4464b
commit 445235ca58
5 changed files with 105 additions and 75 deletions
+11 -2
View File
@@ -88,7 +88,7 @@
rule: 'A picture’s licence follows the sources it is made from.',
licences: [
{ licence: 'CC BY-SA 4.0', licence_url: CC('by-sa'), when: 'made from a CC BY-SA photo' },
{ licence: 'CC BY-NC-SA 4.0', licence_url: CC('by-nc-sa'), when: 'made from EOX’s mosaics after 2016' },
{ licence: 'CC BY-NC-SA 4.0', licence_url: CC('by-nc-sa'), when: 'made from EOxCloudless 2025' },
{ licence: 'CC BY 4.0', licence_url: CC('by'), when: 'otherwise' },
],
},
@@ -104,6 +104,15 @@
const link = (href, text) => (href ? h('a', { href, target: '_blank', rel: 'noopener' }, text || href) : text || '–');
/** What a source is used for, its options (bg=photo, bg=satellite, …) set as code so they read as the options they are. */
function usedFor(text) {
const out = h('span');
for (const part of String(text).split(/(\b(?:bg|photo|locator|track)=[a-z0-9#]+(?:\|[a-z0-9]+)*)/)) {
if (part) out.append(/^(bg|photo|locator|track)=/.test(part) ? h('code', {}, part) : part);
}
return out;
}
/** A credit form, its placeholders marked. */
function credit(text) {
const code = h('code');
@@ -119,7 +128,7 @@
h('thead', {}, h('tr', {}, ...['Source', 'Used for', 'Licence', 'Credit', 'Terms', 'A picture from it'].map((t) => h('th', {}, t)))),
h('tbody', {}, ...sources.map((s) => h('tr', { id: `source-${s.id}` },
h('td', {}, h('b', {}, s.name || s.id), h('br'), h('small', {}, h('code', {}, s.id))),
h('td', {}, s.used_for || '–'),
h('td', {}, s.used_for ? usedFor(s.used_for) : '–'),
h('td', {}, link(s.licence_url, s.licence)),
h('td', {}, credit(s.credit)),
h('td', {}, s.terms ? link(s.terms, new URL(s.terms, location.href).host || s.terms) : '–'),