Leaflet Map Control.Attribution—归因控件允许您在地图上的小文本框中显示归因数据

Leaflet Map Control.Attribution—归因控件允许您在地图上的小文本框中显示归因数据

归因控件允许您在地图上的小文本框中显示归因数据。默认情况下,它会放在地图上,除非您将其attributionControl选项设置为false,并且它会自动使用getAttribution方法从层中获取归因文本。扩展控制。

Creation

FactoryDescription
L.control.attribution(<Control.Attribution optionsoptions)Creates an attribution control.
创建归因控件。

Options

OptionTypeDefaultDescription
prefixString|false'Leaflet'The HTML text shown before the attributions. Pass false to disable.
属性之前显示的HTML文本。传递false以禁用。

▶ Options inherited from Control

从控件继承的选项

OptionTypeDefaultDescription
positionString'topright'The position of the control (one of the map corners). Possible values are 'topleft''topright''bottomleft' or 'bottomright'
控件的位置(地图角之一)。可能的值为“topleft”、“topright”、“bottomleft”或“bottomright”

Methods

MethodReturnsDescription
setPrefix(<String|false> prefix)thisThe HTML text shown before the attributions. Pass false to disable.
属性之前显示的HTML文本。传递false以禁用。
addAttribution(<String> text)thisAdds an attribution text (e.g. '&copy; OpenStreetMap contributors').
添加归因文本(例如“&copy;OpenStreetMap贡献者”)。
removeAttribution(<String> text)thisRemoves an attribution text.
删除归因文本。

▶ Methods inherited from Control

从控件继承的方法

MethodReturnsDescription
getPosition()stringReturns the position of the control.
返回控件的位置。
setPosition(<string> position)thisSets the position of the control.
设置控件的位置。
getContainer()HTMLElementReturns the HTMLElement that contains the control.
返回包含控件的HTMLElement。
addTo(<Mapmap)thisAdds the control to the given map.
将控件添加到给定的映射。
remove()thisRemoves the control from the map it is currently active on.
从当前处于活动状态的贴图中删除控件。
4 1 投票
文章评分
订阅评论
提醒
0 评论
内联反馈
查看所有评论
0
希望看到您的想法,请您发表评论x