ol7源码学习之Overlay

Overlay类

NameTypeDescription
idnumber | string | undefined

Set the overlay id. The overlay id can be used with the getOverlayById method.

elementHTMLElement | undefined覆盖的元素
offsetArray.<number> (defaults to [0, 0])

水平偏移和垂直偏移

positionCoordinate | undefined地图投影中的叠加位置。可以用setposition
positioningPositioning (defaults to 'top-left')

Defines how the overlay is actually positioned with respect to its position property. Possible values are 'bottom-left''bottom-center''bottom-right''center-left''center-center''center-right''top-left''top-center', and 'top-right'.

stopEventboolean (defaults to true)

是否应该停止向地图视口的事件传播

insertFirstboolean (defaults to true)

Whether the overlay is inserted first in the overlay container, or appended. If the overlay is placed in the same container as that of the controls (see the stopEvent option) you will probably set insertFirst to true so the overlay is displayed below the controls.

autoPanPanIntoViewOptions | boolean (defaults to false)

Pan the map when calling setPosition, so that the overlay is entirely visible in the current viewport.

classNamestring (defaults to 'ol-overlay-container ol-selectable')

CSS class name.

方法:

setPosition(position)                             设置这个叠加的位置。 如果位置未定义,叠加将被隐藏。 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值