From 2919d8b7bf6bac91a1880bcd47fedf217faf8ef2 Mon Sep 17 00:00:00 2001 From: perliedman Date: Mon, 14 Dec 2015 14:19:17 +0100 Subject: [PATCH] src/layer/marker/DivIcon.js Cast bgPos to L.Point. Fixes #4067 --- src/layer/marker/DivIcon.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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');