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

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 {

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 {

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);

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

View File

@@ -248,6 +248,5 @@ ol.pointer.MouseSource.prototype.cancel = function(inEvent) {
* Remove the mouse from the list of active pointers.
*/
ol.pointer.MouseSource.prototype.cleanupMouse = function() {
goog.object.remove(this.pointerMap,
ol.pointer.MouseSource.POINTER_ID.toString());
delete this.pointerMap[ol.pointer.MouseSource.POINTER_ID.toString()];
};

View File

@@ -30,7 +30,6 @@
goog.provide('ol.pointer.MsSource');
goog.require('goog.object');
goog.require('ol.pointer.EventSource');
@@ -98,7 +97,7 @@ ol.pointer.MsSource.prototype.prepareEvent_ = function(inEvent) {
* @param {number} pointerId
*/
ol.pointer.MsSource.prototype.cleanup = function(pointerId) {
goog.object.remove(this.pointerMap, pointerId);
delete this.pointerMap[pointerId.toString()];
};
@@ -108,7 +107,7 @@ ol.pointer.MsSource.prototype.cleanup = function(pointerId) {
* @param {goog.events.BrowserEvent} inEvent
*/
ol.pointer.MsSource.prototype.msPointerDown = function(inEvent) {
this.pointerMap[inEvent.getBrowserEvent().pointerId] = inEvent;
this.pointerMap[inEvent.getBrowserEvent().pointerId.toString()] = inEvent;
var e = this.prepareEvent_(inEvent);
this.dispatcher.down(e, inEvent);
};

View File

@@ -425,7 +425,7 @@ ol.pointer.TouchSource.prototype.cancelOut_ =
* @param {Object} inPointer
*/
ol.pointer.TouchSource.prototype.cleanUpPointer_ = function(inPointer) {
goog.object.remove(this.pointerMap, inPointer.pointerId);
delete this.pointerMap[inPointer.pointerId];
this.removePrimaryPointer_(inPointer);
};

View File

@@ -118,7 +118,7 @@ ol.structs.RBush.prototype.remove = function(value) {
// get the object in which the value was wrapped when adding to the
// internal rbush. then use that object to do the removal.
var item = this.items_[uid];
goog.object.remove(this.items_, uid);
delete this.items_[uid];
return this.rbush_.remove(item) !== null;
};