Skip to content

Commit

Permalink
Fix extend/inherit and other minor errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Anand Thakker committed Jun 7, 2016
1 parent c1b1e7c commit 2773f2f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion js/source/geojson_source.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function GeoJSONSource(id, options, dispatcher) {
}.bind(this));
}

GeoJSONSource.prototype = util.extend(Evented, /** @lends GeoJSONSource.prototype */ {
GeoJSONSource.prototype = util.inherit(Evented, /** @lends GeoJSONSource.prototype */ {
minzoom: 0,
maxzoom: 18,
tileSize: 512,
Expand Down
5 changes: 4 additions & 1 deletion js/source/image_source.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ var RasterBoundsArray = require('../render/draw_raster').RasterBoundsArray;
var Buffer = require('../data/buffer');
var VertexArrayObject = require('../render/vertex_array_object');

module.exports = ImageSource;
module.exports.create = function (id, options, dispatcher) {
return new ImageSource(id, options, dispatcher);
};

/**
* Create an Image source instance given an options object
Expand Down Expand Up @@ -48,6 +50,7 @@ function ImageSource(options) {
}.bind(this));

this._loaded = true;
this.fire('load');

if (this.map) {
this.setCoordinates(options.coordinates);
Expand Down
4 changes: 2 additions & 2 deletions js/source/tile_pyramid.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function TilePyramid(id, options, dispatcher) {
}.bind(this));

this._tiles = {};
this._cache = new Cache(0, this.unload.bind(this));
this._cache = new Cache(0, this.unloadTile.bind(this));

this._filterRendered = this._filterRendered.bind(this);
}
Expand Down Expand Up @@ -285,7 +285,7 @@ TilePyramid.prototype = util.inherit(Evented, {
// better, retained tiles. They are not drawn separately.
this._coveredTiles = {};

var required = this.used ? transform.coveringTiles(this) : [];
var required = this.used ? transform.coveringTiles(this._source) : [];
for (i = 0; i < required.length; i++) {
coord = required[i];
tile = this.addTile(coord);
Expand Down
2 changes: 1 addition & 1 deletion js/source/vector_tile_source.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function VectorTileSource(id, options, dispatcher) {
}.bind(this));
}

VectorTileSource.prototype = util.extend(Evented, {
VectorTileSource.prototype = util.inherit(Evented, {
minzoom: 0,
maxzoom: 22,
scheme: 'xyz',
Expand Down
2 changes: 2 additions & 0 deletions js/source/video_source.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ function VideoSource(id, options) {
this.video.play();
this.setCoordinates(options.coordinates);
}

this.fire('load');
}.bind(this));
}

Expand Down

0 comments on commit 2773f2f

Please sign in to comment.