makes image object instead of passing just the name
This commit is contained in:
parent
3cdd89ab24
commit
ead86bad00
@ -72,7 +72,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function renderSprite(ctx, st) {
|
function renderSprite(ctx, st) {
|
||||||
var img = st['point-file'] || st['marker-file'];
|
var img_name = st['point-file'] || st['marker-file'];
|
||||||
|
var img = new Image();
|
||||||
|
img.src = img_name;
|
||||||
var ratio = img.height/img.width;
|
var ratio = img.height/img.width;
|
||||||
var w = st['marker-width'] || img.width;
|
var w = st['marker-width'] || img.width;
|
||||||
var h = st['marker-width'] || st['marker-height'] || w*ratio;
|
var h = st['marker-width'] || st['marker-height'] || w*ratio;
|
||||||
|
Loading…
Reference in New Issue
Block a user