I tried with this code but it wont load the coordinates.the source is fine because it appears in the map when i added it..
map.addSource("villa-route-source",{
type: "geojson",
data: "https://api.myjson.com/bins/h71ul"
})
var route = map.addLayer( {
"id": "villa-route",
"type": "LineString",
"source": "villa-route-source",
"paint": {
"line-color": "#888",
"line-width": 8
}
});
var coordinates = route.features[0].geometry.coordinates;
my purpose is to use the geojson into the turf.along and take its coordinates at specific interval and make a line animation.. I can easily put the geojson code easily and it would work but i want it to be a external source.