ol.source.getState() doesn't seem to be reliable. When I call it on a vector source it returns ready, but the features are not available yet. Code looks like this:
var vectorSource = new ol.source.Vector({ url: 'world.topo.json', format: new ol.format.TopoJSON() }); // ... init map with vectorSource console.log(vectorSource.getState()); // returns "ready" console.log(vectorSource.getFeatureById("US")); // returns null Any other way to see if a vector source is ready?
أكثر...
var vectorSource = new ol.source.Vector({ url: 'world.topo.json', format: new ol.format.TopoJSON() }); // ... init map with vectorSource console.log(vectorSource.getState()); // returns "ready" console.log(vectorSource.getFeatureById("US")); // returns null Any other way to see if a vector source is ready?
أكثر...