2

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

4

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

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.