OpenLayers下将浮云框显示位置固定
OpenLayers下对浮云框显示位置的处理非常灵活,可以根据指向的锚点自动调整自身位置。但是有时候我们并不需要这种功能,需要将位置固定到某一方位,比如右上角。经研究可以在OpenLayer库引入后加入以下代码:
OpenLayers.Popup.FramedCloud.prototype.fixedRelativePosition = true;
OpenLayers.Popup.FramedCloud.prototype.relativePosition = "tr";
relativePosition 所代表的方位值可以使用”tl”, “tr”, “bl”, “br”分别表示”左上”,”右上”,”左下”,“右下”。
转载自:https://blog.csdn.net/zhangjie617/article/details/37932319