如何在js中从json存储数组中的选择性数据

时间:2016-09-05 14:09:50

标签: javascript arrays json leaflet geojson

$.getJSON("rodents.geojson", function(data) {

    var ratIcon = L.icon({
        iconUrl: 'rat.png',
        iconSize: [40, 30]

    });

    L.geoJson(data, {
        pointToLayer: function(feature, latlng) {
            return L.marker(latlng, {
                icon: ratIcon
            });
        }
    }).addTo(map);

    var pointlist[];
    var firstpolyline = new L.Polyline(pointlist, {
        color: 'red',
        weight: 3,
        opacity: 0.5,
        smoothFactor: 1

    });
    firstpolyline.addTo(map);
});

我想从geojson数据中填充坐标,我正在从geojson点中选择点的绘制线

0 个答案:

没有答案