Interaction in ol.interaction namespace.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
goog.provide('ol.interaction.DblClickZoom');
|
||||
|
||||
goog.require('goog.events.EventType');
|
||||
goog.require('ol.Interaction');
|
||||
goog.require('ol.interaction.Interaction');
|
||||
goog.require('ol.MapBrowserEvent');
|
||||
goog.require('ol.interaction.Constraints');
|
||||
|
||||
@@ -9,13 +9,13 @@ goog.require('ol.interaction.Constraints');
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.Interaction}
|
||||
* @extends {ol.interaction.Interaction}
|
||||
* @param {ol.interaction.Constraints} constraints Constraints.
|
||||
*/
|
||||
ol.interaction.DblClickZoom = function(constraints) {
|
||||
goog.base(this, constraints);
|
||||
};
|
||||
goog.inherits(ol.interaction.DblClickZoom, ol.Interaction);
|
||||
goog.inherits(ol.interaction.DblClickZoom, ol.interaction.Interaction);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@ goog.require('goog.asserts');
|
||||
goog.require('goog.events.EventType');
|
||||
goog.require('goog.functions');
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Interaction');
|
||||
goog.require('ol.interaction.Interaction');
|
||||
goog.require('ol.MapBrowserEvent');
|
||||
goog.require('ol.interaction.Constraints');
|
||||
|
||||
@@ -13,7 +13,7 @@ goog.require('ol.interaction.Constraints');
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.Interaction}
|
||||
* @extends {ol.interaction.Interaction}
|
||||
* @param {ol.interaction.Constraints} constraints Constraints.
|
||||
*/
|
||||
ol.interaction.Drag = function(constraints) {
|
||||
@@ -57,7 +57,7 @@ ol.interaction.Drag = function(constraints) {
|
||||
this.startCoordinate = null;
|
||||
|
||||
};
|
||||
goog.inherits(ol.interaction.Drag, ol.Interaction);
|
||||
goog.inherits(ol.interaction.Drag, ol.interaction.Interaction);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// FIXME factor out key precondition (shift et. al)
|
||||
|
||||
goog.provide('ol.Interaction');
|
||||
goog.provide('ol.interaction.Interaction');
|
||||
|
||||
goog.require('ol.MapBrowserEvent');
|
||||
goog.require('ol.interaction.Constraints');
|
||||
@@ -11,7 +11,7 @@ goog.require('ol.interaction.Constraints');
|
||||
* @constructor
|
||||
* @param {ol.interaction.Constraints} constraints Constraints.
|
||||
*/
|
||||
ol.Interaction = function(constraints) {
|
||||
ol.interaction.Interaction = function(constraints) {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
@@ -26,7 +26,7 @@ ol.Interaction = function(constraints) {
|
||||
* @param {ol.Map} map Map.
|
||||
* @param {ol.Extent} extent Extent.
|
||||
*/
|
||||
ol.Interaction.prototype.fitExtent = function(map, extent) {
|
||||
ol.interaction.Interaction.prototype.fitExtent = function(map, extent) {
|
||||
var resolution = map.getResolutionForExtent(extent);
|
||||
resolution = this.constraints.resolution(resolution, 0);
|
||||
var center = extent.getCenter();
|
||||
@@ -41,7 +41,7 @@ ol.Interaction.prototype.fitExtent = function(map, extent) {
|
||||
/**
|
||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
*/
|
||||
ol.Interaction.prototype.handleMapBrowserEvent = goog.abstractMethod;
|
||||
ol.interaction.Interaction.prototype.handleMapBrowserEvent = goog.abstractMethod;
|
||||
|
||||
|
||||
/**
|
||||
@@ -49,7 +49,7 @@ ol.Interaction.prototype.handleMapBrowserEvent = goog.abstractMethod;
|
||||
* @param {ol.Coordinate} delta Delta.
|
||||
* @param {ol.Coordinate=} opt_anchor Anchor.
|
||||
*/
|
||||
ol.Interaction.prototype.pan = function(map, delta, opt_anchor) {
|
||||
ol.interaction.Interaction.prototype.pan = function(map, delta, opt_anchor) {
|
||||
var center = opt_anchor ? opt_anchor : map.getCenter();
|
||||
var resolution = map.getResolution();
|
||||
center = this.constraints.center(center, resolution, delta);
|
||||
@@ -63,7 +63,7 @@ ol.Interaction.prototype.pan = function(map, delta, opt_anchor) {
|
||||
* @param {number} delta Delta.
|
||||
* @param {ol.Coordinate=} opt_anchor Anchor.
|
||||
*/
|
||||
ol.Interaction.prototype.rotate = function(map, rotation, delta, opt_anchor) {
|
||||
ol.interaction.Interaction.prototype.rotate = function(map, rotation, delta, opt_anchor) {
|
||||
// FIXME handle rotation about anchor
|
||||
rotation = this.constraints.rotation(rotation, delta);
|
||||
map.setRotation(rotation);
|
||||
@@ -74,7 +74,7 @@ ol.Interaction.prototype.rotate = function(map, rotation, delta, opt_anchor) {
|
||||
* @param {ol.Map} map Map.
|
||||
* @param {number|undefined} resolution Resolution.
|
||||
*/
|
||||
ol.Interaction.prototype.setResolution = function(map, resolution) {
|
||||
ol.interaction.Interaction.prototype.setResolution = function(map, resolution) {
|
||||
resolution = this.constraints.resolution(resolution, 0);
|
||||
map.setResolution(resolution);
|
||||
};
|
||||
@@ -86,7 +86,7 @@ ol.Interaction.prototype.setResolution = function(map, resolution) {
|
||||
* @param {number} delta Delta.
|
||||
* @param {ol.Coordinate=} opt_anchor Anchor.
|
||||
*/
|
||||
ol.Interaction.prototype.zoom = function(map, resolution, delta, opt_anchor) {
|
||||
ol.interaction.Interaction.prototype.zoom = function(map, resolution, delta, opt_anchor) {
|
||||
if (goog.isDefAndNotNull(opt_anchor)) {
|
||||
var anchor = opt_anchor;
|
||||
var mapCenter = /** @type {!ol.Coordinate} */ map.getCenter();
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
goog.provide('ol.interaction.Keyboard');
|
||||
|
||||
goog.require('ol.Interaction');
|
||||
goog.require('ol.interaction.Interaction');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.Interaction}
|
||||
* @extends {ol.interaction.Interaction}
|
||||
*/
|
||||
ol.interaction.Keyboard = function() {
|
||||
|
||||
@@ -21,7 +21,7 @@ ol.interaction.Keyboard = function() {
|
||||
this.charCodeCallbacks_ = {};
|
||||
|
||||
};
|
||||
goog.inherits(ol.interaction.Keyboard, ol.Interaction);
|
||||
goog.inherits(ol.interaction.Keyboard, ol.interaction.Interaction);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,14 +2,14 @@ goog.provide('ol.interaction.KeyboardPan');
|
||||
|
||||
goog.require('goog.events.KeyCodes');
|
||||
goog.require('goog.events.KeyHandler.EventType');
|
||||
goog.require('ol.Interaction');
|
||||
goog.require('ol.interaction.Interaction');
|
||||
goog.require('ol.interaction.Constraints');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.Interaction}
|
||||
* @extends {ol.interaction.Interaction}
|
||||
* @param {ol.interaction.Constraints} constraints Constraints.
|
||||
* @param {number} pixelDelta Pixel delta.
|
||||
*/
|
||||
@@ -24,7 +24,7 @@ ol.interaction.KeyboardPan = function(constraints, pixelDelta) {
|
||||
this.pixelDelta_ = pixelDelta;
|
||||
|
||||
};
|
||||
goog.inherits(ol.interaction.KeyboardPan, ol.Interaction);
|
||||
goog.inherits(ol.interaction.KeyboardPan, ol.interaction.Interaction);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,20 +2,20 @@ goog.provide('ol.interaction.KeyboardZoom');
|
||||
|
||||
goog.require('goog.events.KeyCodes');
|
||||
goog.require('goog.events.KeyHandler.EventType');
|
||||
goog.require('ol.Interaction');
|
||||
goog.require('ol.interaction.Interaction');
|
||||
goog.require('ol.interaction.ResolutionConstraintType');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.Interaction}
|
||||
* @extends {ol.interaction.Interaction}
|
||||
* @param {ol.interaction.Constraints} constraints Constraints.
|
||||
*/
|
||||
ol.interaction.KeyboardZoom = function(constraints) {
|
||||
goog.base(this, constraints);
|
||||
};
|
||||
goog.inherits(ol.interaction.KeyboardZoom, ol.Interaction);
|
||||
goog.inherits(ol.interaction.KeyboardZoom, ol.interaction.Interaction);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,13 +9,13 @@ goog.require('ol.interaction.Constraints');
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.Interaction}
|
||||
* @extends {ol.interaction.Interaction}
|
||||
* @param {ol.interaction.Constraints} constraints Constraints.
|
||||
*/
|
||||
ol.interaction.MouseWheelZoom = function(constraints) {
|
||||
goog.base(this, constraints);
|
||||
};
|
||||
goog.inherits(ol.interaction.MouseWheelZoom, ol.Interaction);
|
||||
goog.inherits(ol.interaction.MouseWheelZoom, ol.interaction.Interaction);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user