1

I am using leaflet label plugin to show labels on markers by using layer.bindLabel('name'). As the number of markers is high the markers come above the label thus labels are not visible clearly. enter image description here

Seems marker and its label have same z-index. I tried changing the z-index of marker by .leaflet-marker-icon{ z-index: 1000;} and also that of the label .lealet-label{z-index: 1001;} but still the result is the same and the z-index of marker is not changed either. What would be solution to this problem?

1 Answer 1

3

AFAIK the label of a feature has by default the same z-index than the marker and the "correct" way to change the z-index of a marker is with the constructor option zIndexOffset or the method setZIndexOffset.

2
  • 2
    In the marker, you can set riseOnHover =true.
    – neogeomat
    Jun 25, 2014 at 9:48
  • neogeomat's solution (set riseOnHover=true in the marker) worked perfectly for me!
    – MattSidor
    Oct 1, 2014 at 0:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.