Classes
Type Definitions
-
Options{Object}
-
Properties:
Name Type Description idnumber | string | undefined 设置覆盖物 ID。覆盖物 ID 可与 getOverlayById 方法一起使用。
elementHTMLElement | undefined 覆盖物元素。
offsetArray.<number>
(defaults to [0, 0])定位覆盖物时使用的像素偏移量。数组中的第一个元素是水平偏移量。正值使覆盖物向右偏移。第二个元素是垂直偏移量。正值使覆盖物向下偏移。
positionCoordinate | undefined 覆盖物在地图投影中的位置。
positioningPositioning
(defaults to 'top-left')定义覆盖物相对于其
position属性的实际定位方式。可能的值为'bottom-left'、'bottom-center'、'bottom-right'、'center-left'、'center-center'、'center-right'、'top-left'、'top-center'和'top-right'。stopEventboolean
(defaults to true)是否应停止向地图视口的事件传播。如果为
true,覆盖物放置在与控件相同的容器中(CSS 类名ol-overlaycontainer-stopevent);如果为false,放置在由className属性指定 CSS 类名的容器中。insertFirstboolean
(defaults to true)覆盖物是否插入到覆盖物容器的前面,或追加到后面。如果覆盖物与控件放置在同一个容器中(参见 stopEvent 选项),您可能需要将 insertFirst 设置为 true,以便覆盖物显示在控件下方。
autoPanPanIntoViewOptions | boolean
(defaults to false)调用
setPosition时平移地图,使覆盖物在当前视口中完全可见。classNamestring
(defaults to 'ol-overlay-container ol-selectable')CSS 类名。
-
OverlayObjectEventTypes{Types} {'change:element'} {'change:map'} {'change:offset'} {'change:position'} {'change:positioning'}
-
-
PanIntoViewOptions{Object}
-
Properties:
Name Type Description animationPanOptions
(defaults to {})平移的动画参数
marginnumber
(defaults to 20)平移到视图中时覆盖物与地图边界之间的边距(像素)。
-
PanOptions{Object}
-
Positioning{'bottom-left'} {'bottom-center'} {'bottom-right'} {'center-left'} {'center-center'} {'center-right'} {'top-left'} {'top-center'} {'top-right'}
-
覆盖物位置:
'bottom-left'、'bottom-center'、'bottom-right'、'center-left'、'center-center'、'center-right'、'top-left'、'top-center'或'top-right'。