Atlaslog
Atlaslog / Leaflet / API reference / Control.Attribution
Leaflet · API reference

Control.Attribution

Quick answer

L.control.attribution collects copyright text from every layer and shows it as a compact strip in a map corner, bottom right by default. Layer attribution options feed it automatically, so providers such as OpenStreetMap are credited without manual addAttribution calls. Place it in any of the four corners through the position option.

Last verified 2026-11-03 · Leaflet 1.9.4 · Cite this page
L.control.attribution( options ) → Control.Attribution
Key points
Example
/* 地图初始化时不创建,稍后手动放到左上角 */
var map = L.map('map', {
  center: [39.907359, 116.391263],
  zoom: 12,
  attributionControl: false
});

L.control.attribution({
  position: 'bottomright',
  prefix: '<a href="/">经纬志</a>'
}).addTo(map);

var osm = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
  attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
Notes
Runnable examplesChinese originalAll API references
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Cite this page

Atlaslog (2026). Control.Attribution. https://www.jingweizhi.com/en/leaflet/api/control-attribution.html (accessed 2026-11-03).