Merge pull request #8693 from wallw-bits/fix-typecheck-image-source
Fix type check errors for Image source
This commit is contained in:
@@ -91,7 +91,6 @@ class ImageSource extends Source {
|
|||||||
constructor(options) {
|
constructor(options) {
|
||||||
super({
|
super({
|
||||||
attributions: options.attributions,
|
attributions: options.attributions,
|
||||||
extent: options.extent,
|
|
||||||
projection: options.projection,
|
projection: options.projection,
|
||||||
state: options.state
|
state: options.state
|
||||||
});
|
});
|
||||||
@@ -232,7 +231,10 @@ class ImageSource extends Source {
|
|||||||
* @param {string} src Source.
|
* @param {string} src Source.
|
||||||
*/
|
*/
|
||||||
export function defaultImageLoadFunction(image, src) {
|
export function defaultImageLoadFunction(image, src) {
|
||||||
image.getImage().src = src;
|
const img = image.getImage();
|
||||||
|
if (img instanceof HTMLImageElement || img instanceof HTMLVideoElement) {
|
||||||
|
img.src = src;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user