Fix compiler type errors
This commit is contained in:
@@ -1160,7 +1160,7 @@ olx.format.ReadOptions.prototype.dataProjection;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Projection of the feature geometries created by the format reader. if not
|
* Projection of the feature geometries created by the format reader. If not
|
||||||
* provided, features will be returned in the `dataProjection`.
|
* provided, features will be returned in the `dataProjection`.
|
||||||
* @type {ol.proj.ProjectionLike|undefined}
|
* @type {ol.proj.ProjectionLike|undefined}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -149,21 +149,22 @@ ol.format.Feature.transformWithOptions = function(
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {(olx.format.WriteOptions|olx.format.ReadOptions)=} opt_options
|
* @param {olx.format.WriteOptions|olx.format.ReadOptions|undefined} options
|
||||||
* Options.
|
* Options.
|
||||||
* @param {ol.proj.ProjectionLike} defaultDataProjection Default projection.
|
* @param {ol.proj.ProjectionLike} defaultDataProjection Default projection.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {(olx.format.WriteOptions|olx.format.ReadOptions)=} Updated options.
|
* @return {olx.format.WriteOptions|olx.format.ReadOptions|undefined}
|
||||||
|
* Updated options.
|
||||||
*/
|
*/
|
||||||
ol.format.Feature.setDefaultDataProjection = function(
|
ol.format.Feature.setDefaultDataProjection = function(
|
||||||
opt_options, defaultDataProjection) {
|
options, defaultDataProjection) {
|
||||||
if (goog.isDef(opt_options)) {
|
if (goog.isDef(options)) {
|
||||||
if (!goog.isDef(opt_options.dataProjection)) {
|
if (!goog.isDef(options.dataProjection)) {
|
||||||
opt_options = {
|
options = {
|
||||||
featureProjection: opt_options.featureProjection,
|
featureProjection: options.featureProjection,
|
||||||
dataProjection: defaultDataProjection
|
dataProjection: defaultDataProjection
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return opt_options;
|
return options;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ ol.format.Polyline.prototype.readGeometryFromText =
|
|||||||
|
|
||||||
// for convenience set a default dataProjection
|
// for convenience set a default dataProjection
|
||||||
opt_options = ol.format.Feature.setDefaultDataProjection(
|
opt_options = ol.format.Feature.setDefaultDataProjection(
|
||||||
opt_options, this.readProjectionFromText(null));
|
opt_options, this.readProjectionFromText(''));
|
||||||
|
|
||||||
return ol.format.Feature.transformWithOptions(
|
return ol.format.Feature.transformWithOptions(
|
||||||
new ol.geom.LineString(coordinates), false, false, opt_options);
|
new ol.geom.LineString(coordinates), false, false, opt_options);
|
||||||
@@ -381,9 +381,10 @@ ol.format.Polyline.prototype.writeGeometryText =
|
|||||||
goog.asserts.assertInstanceof(geometry, ol.geom.LineString);
|
goog.asserts.assertInstanceof(geometry, ol.geom.LineString);
|
||||||
// for convenience set a default dataProjection
|
// for convenience set a default dataProjection
|
||||||
opt_options = ol.format.Feature.setDefaultDataProjection(
|
opt_options = ol.format.Feature.setDefaultDataProjection(
|
||||||
opt_options, this.readProjectionFromText(null));
|
opt_options, this.readProjectionFromText(''));
|
||||||
geometry = ol.format.Feature.transformWithOptions(
|
geometry = /** @type {ol.geom.LineString} */
|
||||||
geometry, true, true, opt_options);
|
(ol.format.Feature.transformWithOptions(
|
||||||
|
geometry, true, true, opt_options));
|
||||||
var flatCoordinates = geometry.getFlatCoordinates();
|
var flatCoordinates = geometry.getFlatCoordinates();
|
||||||
var stride = geometry.getStride();
|
var stride = geometry.getStride();
|
||||||
return ol.format.Polyline.encodeDeltas(flatCoordinates, stride, this.factor_);
|
return ol.format.Polyline.encodeDeltas(flatCoordinates, stride, this.factor_);
|
||||||
|
|||||||
@@ -271,8 +271,11 @@ ol.format.XMLFeature.transformFeaturesWithOptions = function(
|
|||||||
}
|
}
|
||||||
|
|
||||||
goog.array.forEach(features, function(feature) {
|
goog.array.forEach(features, function(feature) {
|
||||||
feature.setGeometry(ol.format.Feature.transformWithOptions(
|
var geom = feature.getGeometry();
|
||||||
feature.getGeometry(), write, false, opt_options));
|
if (goog.isDef(geom)) {
|
||||||
|
feature.setGeometry(ol.format.Feature.transformWithOptions(
|
||||||
|
geom, write, false, opt_options));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return features;
|
return features;
|
||||||
|
|||||||
Reference in New Issue
Block a user