Skip to content

Commit

Permalink
Fix bug preventing attribution from being displayed (#2972)
Browse files Browse the repository at this point in the history
* Fix bug preventing attribution from being displayed

* Add test case
  • Loading branch information
lucaswoj authored and mourner committed Aug 10, 2016
1 parent 7ed36f0 commit 0feb61e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions js/source/source_cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
10 changes: 10 additions & 0 deletions test/js/source/source_cache.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0feb61e

Please sign in to comment.