带有两个按钮(放大和缩小)的基本缩放控件。除非将其zoomControl选项设置为false,否则默认情况下会将其放置在地图上。扩展控制。
Creation
Options
Option | Type | Default | Description |
---|
zoomInText | String | '<span aria-hidden="true">+</span>' | The text set on the ‘zoom in’ button. “放大”按钮上设置的文本。 |
zoomInTitle | String | 'Zoom in' | The title set on the ‘zoom in’ button. “放大”按钮上设置的标题。 |
zoomOutText | String | '<span aria-hidden="true">−</span>' | The text set on the ‘zoom out’ button. “缩小”按钮上设置的文本。 |
zoomOutTitle | String | 'Zoom out' | The title set on the ‘zoom out’ button. “缩小”按钮上设置的标题。 |
▶ Options inherited from Control
Option | Type | Default | Description |
---|
position | String | 'topright' | The position of the control (one of the map corners). Possible values are 'topleft' , 'topright' , 'bottomleft' or 'bottomright' 控件的位置(地图角之一)。可能的值为“topleft”、“topright”、“bottomleft”或“bottomright” |
Methods
▶ Methods inherited from Control
Method | Returns | Description |
---|
getPosition() | string | Returns the position of the control. 返回控件的位置。 |
setPosition(<string> position) | this | Sets the position of the control. 设置控件的位置。 |
getContainer() | HTMLElement | Returns the HTMLElement that contains the control. 返回包含控件的HTMLElement。 |
addTo(<Map> map) | this | Adds the control to the given map. 将控件添加到给定的映射。 |
remove() | this | Removes the control from the map it is currently active on. 从当前处于活动状态的贴图中删除控件。 |