Use ol.inherits instead of goog.inherits

This commit is contained in:
Frederic Junod
2016-04-07 16:26:11 +02:00
parent 072728b083
commit e289bfbb7d
166 changed files with 448 additions and 452 deletions

View File

@@ -25,7 +25,7 @@ ol.interaction.DoubleClickZoom = function(opt_options) {
*/
this.delta_ = options.delta ? options.delta : 1;
goog.base(this, {
ol.interaction.Interaction.call(this, {
handleEvent: ol.interaction.DoubleClickZoom.handleEvent
});
@@ -36,7 +36,7 @@ ol.interaction.DoubleClickZoom = function(opt_options) {
this.duration_ = options.duration !== undefined ? options.duration : 250;
};
goog.inherits(ol.interaction.DoubleClickZoom, ol.interaction.Interaction);
ol.inherits(ol.interaction.DoubleClickZoom, ol.interaction.Interaction);
/**

View File

@@ -26,7 +26,7 @@ ol.interaction.DragAndDrop = function(opt_options) {
var options = opt_options ? opt_options : {};
goog.base(this, {
ol.interaction.Interaction.call(this, {
handleEvent: ol.interaction.DragAndDrop.handleEvent
});
@@ -57,7 +57,7 @@ ol.interaction.DragAndDrop = function(opt_options) {
this.target = options.target ? options.target : null;
};
goog.inherits(ol.interaction.DragAndDrop, ol.interaction.Interaction);
ol.inherits(ol.interaction.DragAndDrop, ol.interaction.Interaction);
/**
@@ -145,7 +145,7 @@ ol.interaction.DragAndDrop.prototype.setMap = function(map) {
this.dropListenKeys_.forEach(ol.events.unlistenByKey);
this.dropListenKeys_ = null;
}
goog.base(this, 'setMap', map);
ol.interaction.Interaction.prototype.setMap.call(this, map);
if (map) {
var dropArea = this.target ? this.target : map.getViewport();
this.dropListenKeys_ = [
@@ -207,7 +207,7 @@ ol.interaction.DragAndDropEventType = {
*/
ol.interaction.DragAndDropEvent = function(type, target, file, opt_features, opt_projection) {
goog.base(this, type, target);
ol.events.Event.call(this, type, target);
/**
* The features parsed from dropped data.
@@ -231,4 +231,4 @@ ol.interaction.DragAndDropEvent = function(type, target, file, opt_features, opt
this.projection = opt_projection;
};
goog.inherits(ol.interaction.DragAndDropEvent, ol.events.Event);
ol.inherits(ol.interaction.DragAndDropEvent, ol.events.Event);

View File

@@ -58,7 +58,7 @@ ol.DragBoxEventType = {
* @implements {oli.DragBoxEvent}
*/
ol.DragBoxEvent = function(type, coordinate, mapBrowserEvent) {
goog.base(this, type);
ol.events.Event.call(this, type);
/**
* The coordinate of the drag event.
@@ -76,7 +76,7 @@ ol.DragBoxEvent = function(type, coordinate, mapBrowserEvent) {
this.mapBrowserEvent = mapBrowserEvent;
};
goog.inherits(ol.DragBoxEvent, ol.events.Event);
ol.inherits(ol.DragBoxEvent, ol.events.Event);
/**
@@ -98,7 +98,7 @@ goog.inherits(ol.DragBoxEvent, ol.events.Event);
*/
ol.interaction.DragBox = function(opt_options) {
goog.base(this, {
ol.interaction.Pointer.call(this, {
handleDownEvent: ol.interaction.DragBox.handleDownEvent_,
handleDragEvent: ol.interaction.DragBox.handleDragEvent_,
handleUpEvent: ol.interaction.DragBox.handleUpEvent_
@@ -132,7 +132,7 @@ ol.interaction.DragBox = function(opt_options) {
this.boxEndCondition_ = options.boxEndCondition ?
options.boxEndCondition : ol.interaction.DragBox.defaultBoxEndCondition;
};
goog.inherits(ol.interaction.DragBox, ol.interaction.Pointer);
ol.inherits(ol.interaction.DragBox, ol.interaction.Pointer);
/**

View File

@@ -21,7 +21,7 @@ goog.require('ol.interaction.Pointer');
*/
ol.interaction.DragPan = function(opt_options) {
goog.base(this, {
ol.interaction.Pointer.call(this, {
handleDownEvent: ol.interaction.DragPan.handleDownEvent_,
handleDragEvent: ol.interaction.DragPan.handleDragEvent_,
handleUpEvent: ol.interaction.DragPan.handleUpEvent_
@@ -60,7 +60,7 @@ ol.interaction.DragPan = function(opt_options) {
this.noKinetic_ = false;
};
goog.inherits(ol.interaction.DragPan, ol.interaction.Pointer);
ol.inherits(ol.interaction.DragPan, ol.interaction.Pointer);
/**

View File

@@ -26,7 +26,7 @@ ol.interaction.DragRotateAndZoom = function(opt_options) {
var options = opt_options ? opt_options : {};
goog.base(this, {
ol.interaction.Pointer.call(this, {
handleDownEvent: ol.interaction.DragRotateAndZoom.handleDownEvent_,
handleDragEvent: ol.interaction.DragRotateAndZoom.handleDragEvent_,
handleUpEvent: ol.interaction.DragRotateAndZoom.handleUpEvent_
@@ -64,7 +64,7 @@ ol.interaction.DragRotateAndZoom = function(opt_options) {
this.duration_ = options.duration !== undefined ? options.duration : 400;
};
goog.inherits(ol.interaction.DragRotateAndZoom, ol.interaction.Pointer);
ol.inherits(ol.interaction.DragRotateAndZoom, ol.interaction.Pointer);
/**

View File

@@ -25,7 +25,7 @@ ol.interaction.DragRotate = function(opt_options) {
var options = opt_options ? opt_options : {};
goog.base(this, {
ol.interaction.Pointer.call(this, {
handleDownEvent: ol.interaction.DragRotate.handleDownEvent_,
handleDragEvent: ol.interaction.DragRotate.handleDragEvent_,
handleUpEvent: ol.interaction.DragRotate.handleUpEvent_
@@ -50,7 +50,7 @@ ol.interaction.DragRotate = function(opt_options) {
*/
this.duration_ = options.duration !== undefined ? options.duration : 250;
};
goog.inherits(ol.interaction.DragRotate, ol.interaction.Pointer);
ol.inherits(ol.interaction.DragRotate, ol.interaction.Pointer);
/**

View File

@@ -40,13 +40,13 @@ ol.interaction.DragZoom = function(opt_options) {
*/
this.out_ = options.out !== undefined ? options.out : false;
goog.base(this, {
ol.interaction.DragBox.call(this, {
condition: condition,
className: options.className || 'ol-dragzoom'
});
};
goog.inherits(ol.interaction.DragZoom, ol.interaction.DragBox);
ol.inherits(ol.interaction.DragZoom, ol.interaction.DragBox);
/**

View File

@@ -61,7 +61,7 @@ ol.interaction.DrawEventType = {
*/
ol.interaction.DrawEvent = function(type, feature) {
goog.base(this, type);
ol.events.Event.call(this, type);
/**
* The feature being drawn.
@@ -71,7 +71,7 @@ ol.interaction.DrawEvent = function(type, feature) {
this.feature = feature;
};
goog.inherits(ol.interaction.DrawEvent, ol.events.Event);
ol.inherits(ol.interaction.DrawEvent, ol.events.Event);
/**
@@ -86,7 +86,7 @@ goog.inherits(ol.interaction.DrawEvent, ol.events.Event);
*/
ol.interaction.Draw = function(options) {
goog.base(this, {
ol.interaction.Pointer.call(this, {
handleDownEvent: ol.interaction.Draw.handleDownEvent_,
handleEvent: ol.interaction.Draw.handleEvent,
handleUpEvent: ol.interaction.Draw.handleUpEvent_
@@ -311,7 +311,7 @@ ol.interaction.Draw = function(options) {
this.updateState_, this);
};
goog.inherits(ol.interaction.Draw, ol.interaction.Pointer);
ol.inherits(ol.interaction.Draw, ol.interaction.Pointer);
/**
@@ -329,7 +329,7 @@ ol.interaction.Draw.getDefaultStyleFunction = function() {
* @inheritDoc
*/
ol.interaction.Draw.prototype.setMap = function(map) {
goog.base(this, 'setMap', map);
ol.interaction.Pointer.prototype.setMap.call(this, map);
this.updateState_();
};

View File

@@ -37,7 +37,7 @@ ol.interaction.InteractionProperty = {
*/
ol.interaction.Interaction = function(options) {
goog.base(this);
ol.Object.call(this);
/**
* @private
@@ -53,7 +53,7 @@ ol.interaction.Interaction = function(options) {
this.handleEvent = options.handleEvent;
};
goog.inherits(ol.interaction.Interaction, ol.Object);
ol.inherits(ol.interaction.Interaction, ol.Object);
/**

View File

@@ -28,7 +28,7 @@ goog.require('ol.interaction.Interaction');
*/
ol.interaction.KeyboardPan = function(opt_options) {
goog.base(this, {
ol.interaction.Interaction.call(this, {
handleEvent: ol.interaction.KeyboardPan.handleEvent
});
@@ -65,7 +65,7 @@ ol.interaction.KeyboardPan = function(opt_options) {
options.pixelDelta : 128;
};
goog.inherits(ol.interaction.KeyboardPan, ol.interaction.Interaction);
ol.inherits(ol.interaction.KeyboardPan, ol.interaction.Interaction);
/**
* Handles the {@link ol.MapBrowserEvent map browser event} if it was a

View File

@@ -25,7 +25,7 @@ goog.require('ol.interaction.Interaction');
*/
ol.interaction.KeyboardZoom = function(opt_options) {
goog.base(this, {
ol.interaction.Interaction.call(this, {
handleEvent: ol.interaction.KeyboardZoom.handleEvent
});
@@ -51,7 +51,7 @@ ol.interaction.KeyboardZoom = function(opt_options) {
this.duration_ = options.duration !== undefined ? options.duration : 100;
};
goog.inherits(ol.interaction.KeyboardZoom, ol.interaction.Interaction);
ol.inherits(ol.interaction.KeyboardZoom, ol.interaction.Interaction);
/**

View File

@@ -63,7 +63,7 @@ ol.ModifyEventType = {
*/
ol.interaction.ModifyEvent = function(type, features, mapBrowserPointerEvent) {
goog.base(this, type);
ol.events.Event.call(this, type);
/**
* The features being modified.
@@ -79,7 +79,7 @@ ol.interaction.ModifyEvent = function(type, features, mapBrowserPointerEvent) {
*/
this.mapBrowserPointerEvent = mapBrowserPointerEvent;
};
goog.inherits(ol.interaction.ModifyEvent, ol.events.Event);
ol.inherits(ol.interaction.ModifyEvent, ol.events.Event);
/**
@@ -94,7 +94,7 @@ goog.inherits(ol.interaction.ModifyEvent, ol.events.Event);
*/
ol.interaction.Modify = function(options) {
goog.base(this, {
ol.interaction.Pointer.call(this, {
handleDownEvent: ol.interaction.Modify.handleDownEvent_,
handleDragEvent: ol.interaction.Modify.handleDragEvent_,
handleEvent: ol.interaction.Modify.handleEvent,
@@ -245,7 +245,7 @@ ol.interaction.Modify = function(options) {
this.lastPointerEvent_ = null;
};
goog.inherits(ol.interaction.Modify, ol.interaction.Pointer);
ol.inherits(ol.interaction.Modify, ol.interaction.Pointer);
/**
@@ -323,7 +323,7 @@ ol.interaction.Modify.prototype.removeFeatureSegmentData_ = function(feature) {
*/
ol.interaction.Modify.prototype.setMap = function(map) {
this.overlay_.setMap(map);
goog.base(this, 'setMap', map);
ol.interaction.Pointer.prototype.setMap.call(this, map);
};

View File

@@ -18,7 +18,7 @@ goog.require('ol.math');
*/
ol.interaction.MouseWheelZoom = function(opt_options) {
goog.base(this, {
ol.interaction.Interaction.call(this, {
handleEvent: ol.interaction.MouseWheelZoom.handleEvent
});
@@ -61,7 +61,7 @@ ol.interaction.MouseWheelZoom = function(opt_options) {
this.timeoutId_ = undefined;
};
goog.inherits(ol.interaction.MouseWheelZoom, ol.interaction.Interaction);
ol.inherits(ol.interaction.MouseWheelZoom, ol.interaction.Interaction);
/**

View File

@@ -20,7 +20,7 @@ goog.require('ol.interaction.Pointer');
*/
ol.interaction.PinchRotate = function(opt_options) {
goog.base(this, {
ol.interaction.Pointer.call(this, {
handleDownEvent: ol.interaction.PinchRotate.handleDownEvent_,
handleDragEvent: ol.interaction.PinchRotate.handleDragEvent_,
handleUpEvent: ol.interaction.PinchRotate.handleUpEvent_
@@ -65,7 +65,7 @@ ol.interaction.PinchRotate = function(opt_options) {
this.duration_ = options.duration !== undefined ? options.duration : 250;
};
goog.inherits(ol.interaction.PinchRotate, ol.interaction.Pointer);
ol.inherits(ol.interaction.PinchRotate, ol.interaction.Pointer);
/**

View File

@@ -20,7 +20,7 @@ goog.require('ol.interaction.Pointer');
*/
ol.interaction.PinchZoom = function(opt_options) {
goog.base(this, {
ol.interaction.Pointer.call(this, {
handleDownEvent: ol.interaction.PinchZoom.handleDownEvent_,
handleDragEvent: ol.interaction.PinchZoom.handleDragEvent_,
handleUpEvent: ol.interaction.PinchZoom.handleUpEvent_
@@ -53,7 +53,7 @@ ol.interaction.PinchZoom = function(opt_options) {
this.lastScaleDelta_ = 1;
};
goog.inherits(ol.interaction.PinchZoom, ol.interaction.Pointer);
ol.inherits(ol.interaction.PinchZoom, ol.interaction.Pointer);
/**

View File

@@ -29,7 +29,7 @@ ol.interaction.Pointer = function(opt_options) {
var handleEvent = options.handleEvent ?
options.handleEvent : ol.interaction.Pointer.handleEvent;
goog.base(this, {
ol.interaction.Interaction.call(this, {
handleEvent: handleEvent
});
@@ -80,7 +80,7 @@ ol.interaction.Pointer = function(opt_options) {
this.targetPointers = [];
};
goog.inherits(ol.interaction.Pointer, ol.interaction.Interaction);
ol.inherits(ol.interaction.Pointer, ol.interaction.Interaction);
/**

View File

@@ -45,7 +45,7 @@ ol.interaction.SelectEventType = {
* @constructor
*/
ol.interaction.SelectEvent = function(type, selected, deselected, mapBrowserEvent) {
goog.base(this, type);
ol.events.Event.call(this, type);
/**
* Selected features array.
@@ -68,7 +68,7 @@ ol.interaction.SelectEvent = function(type, selected, deselected, mapBrowserEven
*/
this.mapBrowserEvent = mapBrowserEvent;
};
goog.inherits(ol.interaction.SelectEvent, ol.events.Event);
ol.inherits(ol.interaction.SelectEvent, ol.events.Event);
/**
@@ -91,7 +91,7 @@ goog.inherits(ol.interaction.SelectEvent, ol.events.Event);
*/
ol.interaction.Select = function(opt_options) {
goog.base(this, {
ol.interaction.Interaction.call(this, {
handleEvent: ol.interaction.Select.handleEvent
});
@@ -202,7 +202,7 @@ ol.interaction.Select = function(opt_options) {
this.removeFeature_, this);
};
goog.inherits(ol.interaction.Select, ol.interaction.Interaction);
ol.inherits(ol.interaction.Select, ol.interaction.Interaction);
/**
@@ -346,7 +346,7 @@ ol.interaction.Select.prototype.setMap = function(map) {
if (currentMap) {
selectedFeatures.forEach(currentMap.unskipFeature, currentMap);
}
goog.base(this, 'setMap', map);
ol.interaction.Interaction.prototype.setMap.call(this, map);
this.featureOverlay_.setMap(map);
if (map) {
selectedFeatures.forEach(map.skipFeature, map);

View File

@@ -47,7 +47,7 @@ goog.require('ol.structs.RBush');
*/
ol.interaction.Snap = function(opt_options) {
goog.base(this, {
ol.interaction.Pointer.call(this, {
handleEvent: ol.interaction.Snap.handleEvent_,
handleDownEvent: ol.functions.TRUE,
handleUpEvent: ol.interaction.Snap.handleUpEvent_
@@ -159,7 +159,7 @@ ol.interaction.Snap = function(opt_options) {
'GeometryCollection': this.writeGeometryCollectionGeometry_
};
};
goog.inherits(ol.interaction.Snap, ol.interaction.Pointer);
ol.inherits(ol.interaction.Snap, ol.interaction.Pointer);
/**
@@ -344,8 +344,7 @@ ol.interaction.Snap.prototype.setMap = function(map) {
keys.length = 0;
features.forEach(this.forEachFeatureRemove_, this);
}
goog.base(this, 'setMap', map);
ol.interaction.Pointer.prototype.setMap.call(this, map);
if (map) {
if (this.features_) {

View File

@@ -47,7 +47,7 @@ ol.interaction.TranslateEventType = {
*/
ol.interaction.TranslateEvent = function(type, features, coordinate) {
goog.base(this, type);
ol.events.Event.call(this, type);
/**
* The features being translated.
@@ -64,7 +64,7 @@ ol.interaction.TranslateEvent = function(type, features, coordinate) {
*/
this.coordinate = coordinate;
};
goog.inherits(ol.interaction.TranslateEvent, ol.events.Event);
ol.inherits(ol.interaction.TranslateEvent, ol.events.Event);
/**
@@ -78,7 +78,7 @@ goog.inherits(ol.interaction.TranslateEvent, ol.events.Event);
* @api
*/
ol.interaction.Translate = function(options) {
goog.base(this, {
ol.interaction.Pointer.call(this, {
handleDownEvent: ol.interaction.Translate.handleDownEvent_,
handleDragEvent: ol.interaction.Translate.handleDragEvent_,
handleMoveEvent: ol.interaction.Translate.handleMoveEvent_,
@@ -144,7 +144,7 @@ ol.interaction.Translate = function(options) {
*/
this.lastFeature_ = null;
};
goog.inherits(ol.interaction.Translate, ol.interaction.Pointer);
ol.inherits(ol.interaction.Translate, ol.interaction.Pointer);
/**