src/layer/marker/DivIcon.js

Cast bgPos to L.Point. Fixes #4067
This commit is contained in:
perliedman 2015-12-14 14:19:17 +01:00
parent 1d6291be8c
commit 2919d8b7bf

View File

@ -23,7 +23,8 @@ L.DivIcon = L.Icon.extend({
div.innerHTML = options.html !== false ? options.html : '';
if (options.bgPos) {
div.style.backgroundPosition = (-options.bgPos.x) + 'px ' + (-options.bgPos.y) + 'px';
var bgPos = L.point(options.bgPos);
div.style.backgroundPosition = (-bgPos.x) + 'px ' + (-bgPos.y) + 'px';
}
this._setIconStyles(div, 'icon');