I'm loading an external geojson file with the next code:
var sourceTour2016 = new ol.source.Vector({
url: 'tourdefrance_2016.geojson',
format: new ol.format.GeoJSON()
});
var layerTour2016 = new ol.layer.Vector({
source: sourceTour2016,
style: styleFunction
});
map.addLayer(layerTour2016); // geojson laag toevoegen aan map
But how is it possible to have the features in an array? if i'm doing
features = [];
features.push(sourceTour2016.getFeatures());
I receive an empty array...