I'm displaying a Geojson layer with Leaflet. I would like to change de default marker icon size.
Here is the code I came up:
$.ajax({
type: "GET",
url: "data.json",
dataType: 'json',
success: function (response) {
geojsonLayer = L.geoJson(response, {
pointToLayer: function(featuer, latlng) {
var smallIcon = L.Icon.extend({
options: {
'iconSize': [10, 10]
}
});
var myIcon = new smallIcon();
return L.marker(latlng, {icon: smallIcon});
},
onEachFeature: onEachFeature
}).addTo(map);
}
});
However, I'm having javascript error when loading the page:
Uncaught TypeError: Cannot read property 'popupAnchor' of undefined
Any clues ?