diff --git a/src/layer/marker/DivIcon.js b/src/layer/marker/DivIcon.js index c1e1cdd3..79301d15 100644 --- a/src/layer/marker/DivIcon.js +++ b/src/layer/marker/DivIcon.js @@ -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');