Skip to content

Commit

Permalink
avoid calling onload for cancelled raster tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner committed Jul 31, 2018
1 parent b263d33 commit 471c785
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export const getImage = function(requestParameters: RequestParameters, callback:
img.onerror = () => callback(new Error(`Could not load image: ${url}`));
img.onload = () => callback(null, img);
img.src = url;
return {cancel: () => { img.src = transparentPngUrl; }};
return {cancel: () => { img.onload = null; img.src = transparentPngUrl; }};
}

// otherwise request the image with XHR to work around caching issues
Expand Down

0 comments on commit 471c785

Please sign in to comment.