Leaflet – How to Remove Link to Leafletjs.com in Attribution Control

leafletoffline

I will use the leaflet for a display showing a historical map of the history museum. It works on a local network that is not connected to the Internet, and visitors can manipulate the map with a stylus to learn about historical matters.

enter image description here

Leaflet will automatically generate a link to leafletjs.com in the attribution.
However, this link does not work because it is on a local network, and if a visitor accidentally touches it with a stylus, an inaccessible error screen will appear, confusing the visitor.

Is it possible to suppress this link to leafletjs.com?

Best Answer

Map object (let's say it's map) has property map.attributionControl which points to default map attribution control, where so called prefix is text Leaflet with a link to the Leaflet home page.

Attribution control prefix can be changed with the .setPrefix method (see https://leafletjs.com/reference.html#control-attribution-option). So to change prefix to text Leaflet without the link, the code could look like this:

map.attributionControl.setPrefix('Leaflet');