Overlay类
Name | Type | Description |
---|---|---|
id | number | string | undefined | Set the overlay id. The overlay id can be used with the getOverlayById method. |
element | HTMLElement | undefined | 覆盖的元素 |
offset | Array.<number> (defaults to [0, 0]) | 水平偏移和垂直偏移 |
position | Coordinate | undefined | 地图投影中的叠加位置。可以用setposition |
positioning | Positioning (defaults to 'top-left') | Defines how the overlay is actually positioned with respect to its |
stopEvent | boolean (defaults to true) | 是否应该停止向地图视口的事件传播 |
insertFirst | boolean (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 |
autoPan | PanIntoViewOptions | boolean (defaults to false) | Pan the map when calling |
className | string (defaults to 'ol-overlay-container ol-selectable') | CSS class name. |
方法:
setPosition(position) 设置这个叠加的位置。 如果位置未定义,叠加将被隐藏。