diff --git a/src/layer/Tooltip.js b/src/layer/Tooltip.js index 29cd0c8c1..1b1cef0b5 100644 --- a/src/layer/Tooltip.js +++ b/src/layer/Tooltip.js @@ -133,17 +133,17 @@ L.Tooltip = L.DivOverlay.extend({ anchor = this._getAnchor(); if (direction === 'top') { - pos = pos.add(L.point(-tooltipWidth / 2 + offset.x, -tooltipHeight + offset.y + anchor.y)); + pos = pos.add(L.point(-tooltipWidth / 2 + offset.x, -tooltipHeight + offset.y + anchor.y, true)); } else if (direction === 'bottom') { - pos = pos.subtract(L.point(tooltipWidth / 2 - offset.x, -offset.y)); + pos = pos.subtract(L.point(tooltipWidth / 2 - offset.x, -offset.y, true)); } else if (direction === 'center') { - pos = pos.subtract(L.point(tooltipWidth / 2 + offset.x, tooltipHeight / 2 - anchor.y + offset.y)); + pos = pos.subtract(L.point(tooltipWidth / 2 + offset.x, tooltipHeight / 2 - anchor.y + offset.y, true)); } else if (direction === 'right' || direction === 'auto' && tooltipPoint.x < centerPoint.x) { direction = 'right'; - pos = pos.add([offset.x + anchor.x, anchor.y - tooltipHeight / 2 + offset.y]); + pos = pos.add(L.point(offset.x + anchor.x, anchor.y - tooltipHeight / 2 + offset.y, true)); } else { direction = 'left'; - pos = pos.subtract(L.point(tooltipWidth + anchor.x - offset.x, tooltipHeight / 2 - anchor.y - offset.y)); + pos = pos.subtract(L.point(tooltipWidth + anchor.x - offset.x, tooltipHeight / 2 - anchor.y - offset.y, true)); } L.DomUtil.removeClass(container, 'leaflet-tooltip-right');