2

Leaflet で Geojson レイヤーを表示しています。デフォルトのマーカー アイコンのサイズを変更したいと思います。

これが私が思いついたコードです:

    $.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);
        }
    });

ただし、ページをロードするときに JavaScript エラーが発生します。

Uncaught TypeError: Cannot read property 'popupAnchor' of undefined 

手がかりはありますか?

4

1 に答える 1