i am using openlayers3,
Fixing problem
Its working now geo.getFeatures();
$.getJSON('url', function(data) {
geo = new ol.source.Vector({
features: (new ol.format.GeoJSON()).readFeatures(data),
projection: pixelProjection
});
});
Problem
i am created source vector as
geo = new ol.source.Vector({
url: '/map/jsonmaps/systems/' + system + '/parts/' + chapter + '/' + selectElement.value + '.geojson',
format: new ol.format.GeoJSON(),
projection: pixelProjection,
style: style
})
after, i want getting this features for this used getFeatures(); function. But this function is returned empty array. After this method, i am try object parse,
console.log(geo)
;
Output Console
I am looking for geo.o and i writing
console.log(geo.o);
and this new output as:
Yes its here, but i could not getting data :D
console.log(geo['o'].length); //output is undefinded
for(item in geo.o){ // is not working
console.log(item);
}