From 03613b5ea35f5a26a3b8032ebcb7437eec206256 Mon Sep 17 00:00:00 2001 From: Nick Peihl Date: Tue, 10 Dec 2019 14:26:09 -0800 Subject: [PATCH 1/2] Inject attribution into vector tile sources --- src/tms_service.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tms_service.js b/src/tms_service.js index c42a2cd..a8f9d5f 100644 --- a/src/tms_service.js +++ b/src/tms_service.js @@ -47,9 +47,12 @@ export class TMSService { const url = this._proxyPath + tileUrl; return this._emsClient.extendUrlWithParams(url); }); + + const htmlAttribution = await this.getHTMLAttribution() inlinedSources[sourceName] = { type: 'vector', ...sourceJson, + attribution: htmlAttribution, tiles: extendedTileUrls }; } From 3d0512c61855150fe7bfb847dacab555c75c5e66 Mon Sep 17 00:00:00 2001 From: Nick Peihl Date: Tue, 10 Dec 2019 14:52:04 -0800 Subject: [PATCH 2/2] review feedback --- src/tms_service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tms_service.js b/src/tms_service.js index a8f9d5f..1c4c569 100644 --- a/src/tms_service.js +++ b/src/tms_service.js @@ -47,7 +47,7 @@ export class TMSService { const url = this._proxyPath + tileUrl; return this._emsClient.extendUrlWithParams(url); }); - + // Override the attribution in the sources with the localized attribution const htmlAttribution = await this.getHTMLAttribution() inlinedSources[sourceName] = { type: 'vector',