Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Wojciechowski committed Mar 10, 2017
1 parent 59408f9 commit c1b0972
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/symbol/sprite_atlas.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@ class SpriteAtlas extends Evented {
this.fire('data', {dataType: 'style'});
}

removeImage(name) {
const image = this.images[name];

if (!image) {
this.fire('error', {error: new Error('No image with this name exists.')});
}

const rect = this.atlas.getBin(name);

this.copy(new Uint32Array(image.width * image.height), image.width, rect, {pixelRatio: this.pixelRatio, x: 0, y: 0, width: image.width, height: image.height}, false);
this.atlas.deref(rect);

this.fire('data', {dataType: 'style'});
}

getImage(name, wrap) {
if (this.images[name]) {
return this.images[name];
Expand Down

0 comments on commit c1b0972

Please sign in to comment.