How can i show the layer like polygon cover all marker in mapbox

21 views Asked by At

error in my code, i can't create a hull by turf because it isn't format input enter image description here


var pointData = [
    [-74.5, 40],
    [-74.6, 40.1],
    [-74.4, 39.9],
    [-74.55, 39.95],
    [-74.65, 40.05],
    [-74.35, 40.15]
];

var pointGeoJSON = {
    type: 'FeatureCollection',
    features: pointData.map(function(coord) {
        return {
            type: 'Feature',
            geometry: {
                type: 'Point',
                coordinates: coord
            }
        };
    })
};

var hull = turf.convex(pointGeoJSON);
0

There are 0 answers