I would like to add a HTML label above each marker in a leaflet map.
Is this possible? Example:
enter image description here
Code for labels:
HTML
<table>
<tr>
<td class="red"></td>
<td class="yellow"></td>
<td class="orange"></td>
<td class="blue"></td>
</tr>
</table>
CSS
table{
border-collapse: collapse;
}
td{
padding:20px;
border:5px solid black;
}
.red{
background-color:#F15E66;
}
.yellow{
background-color:#FFDB64;
}
.orange{
background-color:#F58326;
}
.blue{
background-color:#85B1DE;
}
Fezter
22k11 gold badges72 silver badges128 bronze badges
asked Feb 11, 2015 at 13:58
1 Answer 1
There's a plugin called Leaflet.label which does what you want: https://github.com/Leaflet/Leaflet.label
answered Feb 11, 2015 at 17:27
default