Mapbox gl JS popup:强制在对面显示弹出窗口

Mapbox gl JS popup : forcing to display popup on the opposite side

在 mapbox gl JS 上,是否可以将弹出窗口配置为出现在计算位置的反面 我是屏幕截图,mapbox 使弹出窗口出现在该位置(绿色),但我想强制它出现在对面,红色

谢谢

这就是 anchor 属性 控制的内容:

A string indicating the part of the Popup that should be positioned closest to the coordinate set via Popup#setLngLat . Options are 'center' , 'top' , 'bottom' , 'left' , 'right' , 'top-left' , 'top-right' , 'bottom-left' , and 'bottom-right' . If unset the anchor will be dynamically set to ensure the popup falls within the map container with a preference for 'bottom' .