Remove unnecessary goog.isDef() checks from map.js
This commit is contained in:
+3
-13
@@ -1201,10 +1201,7 @@ ol.Map.prototype.render = function() {
|
|||||||
ol.Map.prototype.removeControl = function(control) {
|
ol.Map.prototype.removeControl = function(control) {
|
||||||
var controls = this.getControls();
|
var controls = this.getControls();
|
||||||
goog.asserts.assert(controls !== undefined, 'controls should be defined');
|
goog.asserts.assert(controls !== undefined, 'controls should be defined');
|
||||||
if (goog.isDef(controls.remove(control))) {
|
return controls.remove(control);
|
||||||
return control;
|
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -1216,14 +1213,10 @@ ol.Map.prototype.removeControl = function(control) {
|
|||||||
* @api stable
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.removeInteraction = function(interaction) {
|
ol.Map.prototype.removeInteraction = function(interaction) {
|
||||||
var removed;
|
|
||||||
var interactions = this.getInteractions();
|
var interactions = this.getInteractions();
|
||||||
goog.asserts.assert(interactions !== undefined,
|
goog.asserts.assert(interactions !== undefined,
|
||||||
'interactions should be defined');
|
'interactions should be defined');
|
||||||
if (goog.isDef(interactions.remove(interaction))) {
|
return interactions.remove(interaction);
|
||||||
removed = interaction;
|
|
||||||
}
|
|
||||||
return removed;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -1250,10 +1243,7 @@ ol.Map.prototype.removeLayer = function(layer) {
|
|||||||
ol.Map.prototype.removeOverlay = function(overlay) {
|
ol.Map.prototype.removeOverlay = function(overlay) {
|
||||||
var overlays = this.getOverlays();
|
var overlays = this.getOverlays();
|
||||||
goog.asserts.assert(overlays !== undefined, 'overlays should be defined');
|
goog.asserts.assert(overlays !== undefined, 'overlays should be defined');
|
||||||
if (goog.isDef(overlays.remove(overlay))) {
|
return overlays.remove(overlay);
|
||||||
return overlay;
|
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user