Remove goog.isNull in interaction classes

This commit is contained in:
Marc Jansen
2015-09-29 15:19:11 +02:00
parent 3c4e663224
commit be2e4a33ae
11 changed files with 52 additions and 56 deletions
+6 -6
View File
@@ -98,11 +98,11 @@ ol.interaction.DragAndDrop.prototype.handleDrop_ = function(event) {
*/
ol.interaction.DragAndDrop.prototype.handleResult_ = function(file, result) {
var map = this.getMap();
goog.asserts.assert(!goog.isNull(map), 'map should not be null');
goog.asserts.assert(map, 'map must be set');
var projection = this.projection_;
if (goog.isNull(projection)) {
if (!projection) {
var view = map.getView();
goog.asserts.assert(!goog.isNull(view), 'view should not be null');
goog.asserts.assert(view, 'map must have view');
projection = view.getProjection();
goog.asserts.assert(projection !== undefined,
'projection should be defined');
@@ -114,7 +114,7 @@ ol.interaction.DragAndDrop.prototype.handleResult_ = function(file, result) {
var formatConstructor = formatConstructors[i];
var format = new formatConstructor();
var readFeatures = this.tryReadFeatures_(format, result);
if (!goog.isNull(readFeatures)) {
if (readFeatures) {
var featureProjection = format.readProjection(result);
var transform = ol.proj.getTransform(featureProjection, projection);
var j, jj;
@@ -154,14 +154,14 @@ ol.interaction.DragAndDrop.prototype.setMap = function(map) {
goog.events.unlistenByKey(this.dropListenKey_);
this.dropListenKey_ = undefined;
}
if (!goog.isNull(this.fileDropHandler_)) {
if (this.fileDropHandler_) {
goog.dispose(this.fileDropHandler_);
this.fileDropHandler_ = null;
}
goog.asserts.assert(this.dropListenKey_ === undefined,
'this.dropListenKey_ should be undefined');
goog.base(this, 'setMap', map);
if (!goog.isNull(map)) {
if (map) {
this.fileDropHandler_ = new goog.events.FileDropHandler(map.getViewport());
this.dropListenKey_ = goog.events.listen(
this.fileDropHandler_, goog.events.FileDropHandler.EventType.DROP,