Merge pull request #4090 from Leaflet/fix-4067

Cast bgPos to L.Point
This commit is contained in:
Iván Sánchez Ortega 2015-12-14 14:22:56 +01:00
commit c954367d09

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');