From 31063a41a47d773b135b50fbb03a6c47569b4fcd Mon Sep 17 00:00:00 2001 From: Lucas Wojciechowski Date: Wed, 10 Aug 2016 07:15:47 -0700 Subject: [PATCH 1/2] Fix bug preventing attribution from being displayed --- js/source/source_cache.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/source/source_cache.js b/js/source/source_cache.js index c72a10dd4ce..941ccd64182 100644 --- a/js/source/source_cache.js +++ b/js/source/source_cache.js @@ -35,6 +35,7 @@ function SourceCache(id, options, dispatcher) { this.roundZoom = source.roundZoom; this.reparseOverscaled = source.reparseOverscaled; this.isTileClipped = source.isTileClipped; + this.attribution = source.attribution; this.vectorLayerIds = source.vectorLayerIds; From e7bab30a9e5f3a1669c9aaa958427a56f3d635eb Mon Sep 17 00:00:00 2001 From: Lucas Wojciechowski Date: Wed, 10 Aug 2016 07:27:06 -0700 Subject: [PATCH 2/2] Add test case --- test/js/source/source_cache.test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/js/source/source_cache.test.js b/test/js/source/source_cache.test.js index 7e3d1c3b880..467beded1dd 100644 --- a/test/js/source/source_cache.test.js +++ b/test/js/source/source_cache.test.js @@ -49,6 +49,16 @@ function createSourceCache(options, used) { return sc; } +test('SourceCache#attribution is set', function(t) { + var sourceCache = createSourceCache({ + attribution: 'Mapbox Heavy Industries' + }); + sourceCache.on('load', function() { + t.equal(sourceCache.attribution, 'Mapbox Heavy Industries'); + t.end(); + }); +}); + test('SourceCache#addTile', function(t) { t.test('loads tile when uncached', function(t) { var coord = new TileCoord(0, 0, 0);