The standard method of using a custom icon as shown in the Leaflet docs isn't working for me when I have a geojson data source. the layer is added fine, but is using the default marker icon. There's no reference to my custom icon PNG when i examine the DOM. Here's my code:
var crossIcon = L.icon({
iconUrl: 'plus.png',
shadowUrl: 'marker-shadow.png',
iconSize: [11, 11],
shadowSize: [11, 11],
iconAnchor: [6, 6],
shadowAnchor: [5, 5],
popupAnchor: [5, 5]
});
var points = L.geoJson(labels, {
icon: crossIcon
});
map.addLayer(points);
layerControl.addOverlay(points, 'Site Locations');
I've tried several suggestions found on SO and elsewhere with no success. plus.png is located in /lib/images/ where the default icon is also found.