归因控件允许您在地图上的小文本框中显示归因数据。默认情况下,它会放在地图上,除非您将其attributionControl选项设置为false,并且它会自动使用getAttribution方法从层中获取归因文本。扩展控制。
Creation
Factory | Description |
---|---|
L.control.attribution(<Control.Attribution options> options) | Creates an attribution control. 创建归因控件。 |
Options
Option | Type | Default | Description |
---|---|---|---|
prefix | String|false | 'Leaflet' | The HTML text shown before the attributions. Pass false to disable.属性之前显示的HTML文本。传递false以禁用。 |
▶ Options inherited from Control
从控件继承的选项
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. 从当前处于活动状态的贴图中删除控件。 |