[GIS] label for circle marker in leaflet

leaflet

I am able to add label to circlemarker like this

L.circleMarker(points[i],{title: 'unselected'}).bindLabel('Destination').addTo(map);

This adds label which appears on mouse hover on circle marker.

But I want to add static label which will appear regardless of mouse is on that circle marker or not.

I am referring this demo http://leaflet.github.com/Leaflet.label/ for adding static label to circle marker but some how I am not able to do it.
It is working fine with markers but with circle Markers static label is not working.

Also is there any other method to add label on circle marker ?

Best Answer

I guess it's already too late to answer, but just for clarification:

The developer himself explains why it is not yet possible to add static labels to polygons.

Leaflet.label just doesn't support static labels for Vectors. I didn't add it as it is hard to decide where to place the label. E.g. If the vector covers more than the screen the label might not be visible even thought the vector is. Where should the label be shown? This could be different for the different shape. E.G. first point for polygon, center for circles, corner for rectangles.

See here: https://github.com/Leaflet/Leaflet.label/issues/15

EDIT: For your information, I solved my own problem by using the "L.divIcon" function that comes with Leaflet built-in. I had to input each and every coordinate for the labels I need to put by hand, and adding each within a loop function.

Related Question