Consider the following example:
请考虑以下示例:
var features = [];
$.getJSON(annotations_url, function(data) {
$.each(data, function(key, val) {
features.push(wkt_parser.read(val.annotation.wkt_data));
// at this point, "features" contains objects
});
});
annotationLayer.addFeatures(features);
// here, it is empty again
va