diff --git a/src/annotations/outlineRungs.js b/src/annotations/outlineRungs.js index 0d5e965c8..88a2361e4 100644 --- a/src/annotations/outlineRungs.js +++ b/src/annotations/outlineRungs.js @@ -290,6 +290,9 @@ export function createOutlineRungs({ const patch = finish(fp, asScope); if (patch?.ring) { patch.outlineCredit = provider === 'openfreemap' ? 'tiles' : 'osm'; + // Which source answered, so a stored area names it (OpenFreeMap or + // Nominatim) instead of defaulting to the Overpass rungs. + patch.outlineSource = provider; ctx.credit?.(patch.outlineCredit); // One line per answered outline, like the resolver's own trace. console.log( diff --git a/src/annotations/outlineRungs.test.mjs b/src/annotations/outlineRungs.test.mjs index cd02a2819..6554e6f61 100644 --- a/src/annotations/outlineRungs.test.mjs +++ b/src/annotations/outlineRungs.test.mjs @@ -146,7 +146,7 @@ test('a street comes from tiles before the configured ladder, as merged ribbons' ); assert.ok(result.ring.length > 6); assert.equal(result.polygons.length, 1); - assert.equal('outlineSource' in result, false); + assert.equal(result.outlineSource, 'openfreemap'); assert.equal(run.calls.base, 0, 'the ladder is not consulted'); assert.deepEqual(run.calls.finished, ['street']); assert.deepEqual(credits, ['tiles']); @@ -416,6 +416,7 @@ test('a city with no configured Overpass is outlined by Nominatim', async () => ); assert.deepEqual(result.ring, ring); assert.equal(result.outlineCredit, 'osm'); + assert.equal(result.outlineSource, 'nominatim'); assert.deepEqual(nominatim.asks[0], { query: 'Toulouse', kind: 'city',