Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am adding markers to the map as below:

var markers = new L.LayerGroup();
L.marker([Latitude], [Longitude]).bindPopup("Hi there").addTo(markers);

I have my own marker icons.Can someone tell me how to add those icons rather than default.....

share|improve this question
Downvote: I am not a fan of answering with “read the docs”, but there is a limit to draw somewhere. – MattiSG Oct 25 '12 at 19:40
up vote 3 down vote accepted
var markers = new L.LayerGroup();   
 var myIcon = L.icon({ 
        iconUrl: 'my-icon.png', // pull out values as desired from the feature
        iconSize: [38, 95],
        iconAnchor: [22, 94],
        popupAnchor: [-3, -76],
        shadowUrl: 'my-icon-shadow.png',
        shadowSize: [68, 95],
        shadowAnchor: [22, 94]

    marker = L.marker([50.505, 30.57], {icon: myIcon}).bindPopup("Hi there").addTo(markers);;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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