Когда я включаю следующий код, маркеры не отображаются, и в консоли появляются следующие ошибки:
Uncaught TypeError: this.callInitHooks не является функцией pointToLayer.
Если вы знаете какие-либо решения, пожалуйста, поделитесь.
var map = L.map('map', {
center: [53.423933, -7.94069],
zoom: 7,
layers: [grayscale]
});
var url = "howdy.json";
var geojsonMarkerOptions = L.icon({
iconUrl: 'howdy.png',
iconSize: [16, 28],
iconAnchor: [8, 18],
popupAnchor: [-3, -13]
});
function forEachFeature(feature, layer) {
var popupContent =
feature.properties.Cabin+
feature.properties.Crew +
feature.properties.Mobile;
if (feature.properties && feature.properties.popupContent) {
popupContent += feature.properties.popupContent;
}
layer.bindPopup(popupContent);
};
var howdy = L.geoJSON(null, {
onEachFeature: forEachFeature,
pointToLayer: function (feature, latlng) {
return L.Marker(latlng, geojsonMarkerOptions);
}
});
$.getJSON(url, function(data) {
Shelter.addData(data);
});
Shelter.addTo(map);