Merge pull request #8693 from wallw-bits/fix-typecheck-image-source

Fix type check errors for Image source
This commit is contained in:
Tim Schaub
2018-09-21 16:51:35 -06:00
committed by GitHub

View File

@@ -91,7 +91,6 @@ class ImageSource extends Source {
constructor(options) {
super({
attributions: options.attributions,
extent: options.extent,
projection: options.projection,
state: options.state
});
@@ -232,7 +231,10 @@ class ImageSource extends Source {
* @param {string} src Source.
*/
export function defaultImageLoadFunction(image, src) {
image.getImage().src = src;
const img = image.getImage();
if (img instanceof HTMLImageElement || img instanceof HTMLVideoElement) {
img.src = src;
}
}