Remove use of goog.object.remove

This commit is contained in:
Frederic Junod
2015-09-22 12:03:52 +02:00
parent 9f57e57400
commit b128675e60
8 changed files with 14 additions and 16 deletions
+1 -1
View File
@@ -656,7 +656,7 @@ ol.format.EsriJSON.prototype.writeFeatureObject = function(
ol.format.EsriJSON.writeGeometry_(geometry, opt_options);
}
var properties = feature.getProperties();
goog.object.remove(properties, feature.getGeometryName());
delete properties[feature.getGeometryName()];
if (!goog.object.isEmpty(properties)) {
object['attributes'] = properties;
} else {
+1 -1
View File
@@ -545,7 +545,7 @@ ol.format.GeoJSON.prototype.writeFeatureObject = function(
object['geometry'] = null;
}
var properties = feature.getProperties();
goog.object.remove(properties, feature.getGeometryName());
delete properties[feature.getGeometryName()];
if (!goog.object.isEmpty(properties)) {
object['properties'] = properties;
} else {
+5 -5
View File
@@ -74,14 +74,14 @@ ol.format.GPX.appendCoordinate_ = function(flatCoordinates, node, values) {
if (goog.object.containsKey(values, 'ele')) {
flatCoordinates.push(
/** @type {number} */ (values['ele']));
goog.object.remove(values, 'ele');
delete values['ele'];
} else {
flatCoordinates.push(0);
}
if (goog.object.containsKey(values, 'time')) {
flatCoordinates.push(
/** @type {number} */ (values['time']));
goog.object.remove(values, 'time');
delete values['time'];
} else {
flatCoordinates.push(0);
}
@@ -200,7 +200,7 @@ ol.format.GPX.readRte_ = function(node, objectStack) {
}
var flatCoordinates = /** @type {Array.<number>} */
(values['flatCoordinates']);
goog.object.remove(values, 'flatCoordinates');
delete values['flatCoordinates'];
var geometry = new ol.geom.LineString(null);
geometry.setFlatCoordinates(ol.geom.GeometryLayout.XYZM, flatCoordinates);
ol.format.Feature.transformWithOptions(geometry, false, options);
@@ -230,9 +230,9 @@ ol.format.GPX.readTrk_ = function(node, objectStack) {
}
var flatCoordinates = /** @type {Array.<number>} */
(values['flatCoordinates']);
goog.object.remove(values, 'flatCoordinates');
delete values['flatCoordinates'];
var ends = /** @type {Array.<number>} */ (values['ends']);
goog.object.remove(values, 'ends');
delete values['ends'];
var geometry = new ol.geom.MultiLineString(null);
geometry.setFlatCoordinates(
ol.geom.GeometryLayout.XYZM, flatCoordinates, ends);
+2 -2
View File
@@ -1686,7 +1686,7 @@ ol.format.KML.prototype.readPlacemark_ = function(node, objectStack) {
ol.format.Feature.transformWithOptions(geometry, false, options);
}
feature.setGeometry(geometry);
goog.object.remove(object, 'geometry');
delete object['geometry'];
if (this.extractStyles_) {
var style = object['Style'];
@@ -1695,7 +1695,7 @@ ol.format.KML.prototype.readPlacemark_ = function(node, objectStack) {
style, styleUrl, this.defaultStyle_, this.sharedStyles_);
feature.setStyle(styleFunction);
}
goog.object.remove(object, 'Style');
delete object['Style'];
// we do not remove the styleUrl property from the object, so it
// gets stored on feature when setProperties is called