leaflet.infobutton
v1.2.0
Published
A button for display information in the leaflet map
Downloads
1
Readme
Leaflet.infoButton
Leaflet.infoButton is a Leaflet plugin that provides a highly css-customizable popup box on the map.
The code is a modified version of the Leaflet.infoButton made by Eclipse1979
Usage:
You can install this plugin via npm:
npm i leaflet.infobutton
After install, you can import and use:
import 'leaflet.infoButton/dist/leaflet.infoButton';
...
L.control.infoButton({
buttonTittle: "I'm a button, press me!",
title: "<h1>This text is customizable</h1>",
position: "bottomleft",
html: "This text is customizable too. <p>I'm a paragraph inside HTML <p> tag</p>"
}).addTo(map);
Options:
title:
title of the popup box, default isAbout
buttonTittle:
title of the popup box, default is<h1>Title</h1>
html:
html content of the popup, default is<p>This map was generated by Leaflet.</p>
show:
wether the popup should activate at the beginning, default isfalse
minWidth:
allows you to hide the map interface on mobile devices by setting a minimum screen size, default is500
- It also support the same options as those of Control such as position.
License:
This project is under the MIT license