Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhamley committed Feb 1, 2019
1 parent cd98e24 commit 23378ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ui/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -1699,6 +1699,7 @@ class Map extends Camera {
const tile = cache.getTileByID(tileKey);
// do not upload aborted tiles to the GPU
if (tile && !tile.aborted) {
console.log('create texture', textureQueue.length);
callback(tile, img);
}
if (textureQueue.length > 0) {
Expand Down
3 changes: 3 additions & 0 deletions src/util/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ resetImageRequestQueue();

export const getImage = function(requestParameters: RequestParameters, callback: Callback<HTMLImageElement>): Cancelable {
// limit concurrent image loads to help with raster sources performance on big screens
console.log('numImageRequests', numImageRequests, 'max requests', config.MAX_PARALLEL_IMAGE_REQUESTS);
if (numImageRequests >= config.MAX_PARALLEL_IMAGE_REQUESTS) {
const queued = {
requestParameters,
Expand All @@ -227,6 +228,7 @@ export const getImage = function(requestParameters: RequestParameters, callback:
assert(numImageRequests >= 0);
while (imageQueue.length && numImageRequests < config.MAX_PARALLEL_IMAGE_REQUESTS) { // eslint-disable-line
const request = imageQueue.shift();
console.log('create image request', imageQueue.length, numImageRequests);
const {requestParameters, callback, cancelled} = request;
if (!cancelled) {
request.cancel = getImage(requestParameters, callback).cancel;
Expand All @@ -243,6 +245,7 @@ export const getImage = function(requestParameters: RequestParameters, callback:
if (err) {
callback(err);
} else if (data) {
console.log('image data returned');
const img: HTMLImageElement = new window.Image();
const URL = window.URL || window.webkitURL;
img.onload = () => {
Expand Down

0 comments on commit 23378ed

Please sign in to comment.