Accept HTMLCanvasElement for an icon's img
This commit is contained in:
@@ -9,6 +9,20 @@ goog.require('ol.style.IconOrigin');
|
||||
describe('ol.style.Icon', function() {
|
||||
var size = [36, 48];
|
||||
|
||||
describe('constructor', function() {
|
||||
|
||||
it('caches canvas images with a uid as src', function() {
|
||||
var canvas = document.createElement('canvas');
|
||||
new ol.style.Icon({
|
||||
img: canvas,
|
||||
imgSize: size
|
||||
});
|
||||
expect(ol.style.IconImage_.get(
|
||||
canvas, goog.getUid(canvas), size, '').getImage()).to.eql(canvas);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('#getAnchor', function() {
|
||||
var fractionAnchor = [0.25, 0.25];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user