Fix compressed popup when reaching right bound of map (#823)

This commit is contained in:
Xintong Xia 2019-06-14 10:33:03 -07:00
parent 277ce9c39d
commit 2dabdf0447

View File

@ -133,12 +133,14 @@ export default class Popup extends BaseControl<PopupProps, *, HTMLDivElement> {
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
};