Skip to content

Commit

Permalink
warn about missing style images
Browse files Browse the repository at this point in the history
  • Loading branch information
ansis committed Mar 12, 2019
1 parent 286370d commit c189971
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/render/image_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ImagePosition } from './image_atlas';
import Texture from './texture';
import assert from 'assert';
import {renderStyleImage} from '../style/style_image';
import { warnOnce } from '../util/util';

import type {StyleImage} from '../style/style_image';
import type Context from '../gl/context';
Expand Down Expand Up @@ -151,6 +152,8 @@ class ImageManager extends Evented {
version: image.version,
hasRenderCallback: Boolean(image.userImage && image.userImage.render)
};
} else {
warnOnce(`Image "${id}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`);
}
}

Expand Down

0 comments on commit c189971

Please sign in to comment.