Skip to content

Commit

Permalink
Fixed test-suite crashes from image_source and video_source
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Wojciechowski committed Nov 16, 2015

Verified

This commit was signed with the committer’s verified signature.
iPaat Patrick
1 parent 1eb900c commit 2529bac
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions js/source/image_source.js
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ var Tile = require('./tile');
var LngLat = require('../geo/lng_lat');
var Point = require('point-geometry');
var Evented = require('../util/evented');
var TileCoord = require('./tile_coord');
var ajax = require('../util/ajax');

module.exports = ImageSource;
@@ -90,7 +91,7 @@ ImageSource.prototype = util.inherit(Evented, {
tileCoords[2].x, tileCoords[2].y, maxInt16, maxInt16
]);

this.tile = new Tile();
this.tile = new Tile(new TileCoord(center.zoom, center.column, center.row), 512, Infinity);
this.tile.buckets = {};

this.tile.boundsBuffer = gl.createBuffer();
@@ -112,13 +113,14 @@ ImageSource.prototype = util.inherit(Evented, {
// noop
},

renderedTiles: function(layers, painter) {
renderedTiles: function() {
if (!this._loaded || !this.loaded()) return [];

var c = this.center;
this.tile.calculateMatrices(c.zoom, c.column, c.row, this.map.transform, painter);

var painter = this.map.painter;
var gl = painter.gl;
var center = this.center;

this.tile.calculateMatrices(center.zoom, center.column, center.row, this.map.transform, painter);

if (!this.tile.texture) {
this.tile.texture = gl.createTexture();
2 changes: 1 addition & 1 deletion js/source/video_source.js
Original file line number Diff line number Diff line change
@@ -97,7 +97,7 @@ VideoSource.prototype = util.inherit(Evented, /** @lends VideoSource.prototype *
return map.transform.locationCoordinate(loc).zoomTo(0);
});

var center = util.getCoordinatesCenter(coords);
var center = this.center = util.getCoordinatesCenter(coords);
var tileExtent = 4096;
var tileCoords = coords.map(function(coord) {
var zoomedCoord = coord.zoomTo(center.zoom);

0 comments on commit 2529bac

Please sign in to comment.