Use addFeatures in ol.source.VectorFile
This commit is contained in:
@@ -106,20 +106,17 @@ ol.source.VectorFile.prototype.readFeatures_ = function(source) {
|
|||||||
var format = this.format;
|
var format = this.format;
|
||||||
var features = format.readFeatures(source);
|
var features = format.readFeatures(source);
|
||||||
var featureProjection = format.readProjection(source);
|
var featureProjection = format.readProjection(source);
|
||||||
var transform;
|
|
||||||
if (!ol.proj.equivalent(featureProjection, this.reprojectTo_)) {
|
if (!ol.proj.equivalent(featureProjection, this.reprojectTo_)) {
|
||||||
transform = ol.proj.getTransform(featureProjection, this.reprojectTo_);
|
var transform = ol.proj.getTransform(featureProjection, this.reprojectTo_);
|
||||||
} else {
|
var i, ii;
|
||||||
transform = null;
|
for (i = 0, ii = features.length; i < ii; ++i) {
|
||||||
}
|
var feature = features[i];
|
||||||
var i, ii;
|
var geometry = feature.getGeometry();
|
||||||
for (i = 0, ii = features.length; i < ii; ++i) {
|
if (!goog.isNull(geometry)) {
|
||||||
var feature = features[i];
|
geometry.transform(transform);
|
||||||
var geometry = feature.getGeometry();
|
}
|
||||||
if (!goog.isNull(geometry) && !goog.isNull(transform)) {
|
|
||||||
geometry.transform(transform);
|
|
||||||
}
|
}
|
||||||
this.addFeature(feature);
|
|
||||||
}
|
}
|
||||||
|
this.addFeaturesInternal(features);
|
||||||
this.setState(ol.source.State.READY);
|
this.setState(ol.source.State.READY);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user