From 2dabdf0447ca2f8c64401b11c1d464ddc97e36e5 Mon Sep 17 00:00:00 2001 From: Xintong Xia Date: Fri, 14 Jun 2019 10:33:03 -0700 Subject: [PATCH] Fix compressed popup when reaching right bound of map (#823) --- src/components/popup.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/popup.js b/src/components/popup.js index d24d37c9..a2a5ea4d 100644 --- a/src/components/popup.js +++ b/src/components/popup.js @@ -133,12 +133,14 @@ export default class Popup extends BaseControl { const {viewport} = this._context; const {offsetLeft, offsetTop, sortByDepth} = this.props; const anchorPosition = ANCHOR_POSITION[positionType]; - + const left = x + offsetLeft; + const top = y + offsetTop; const style = { position: 'absolute', - left: x + offsetLeft, - top: y + offsetTop, - transform: `translate(${-anchorPosition.x * 100}%, ${-anchorPosition.y * 100}%)`, + transform: ` + translate(${-anchorPosition.x * 100}%, ${-anchorPosition.y * 100}%) + translate(${left}px, ${top}px) + `, display: undefined, zIndex: undefined };