Be more consistent with control options
This commit is contained in:
@@ -20,7 +20,7 @@ goog.require('ol.source.Source');
|
|||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.control.Control}
|
* @extends {ol.control.Control}
|
||||||
* @param {ol.control.AttributionOptions=} opt_options Options.
|
* @param {ol.control.AttributionOptions=} opt_options Attribution options.
|
||||||
*/
|
*/
|
||||||
ol.control.Attribution = function(opt_options) {
|
ol.control.Attribution = function(opt_options) {
|
||||||
|
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ ol.control.ControlOptions;
|
|||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {goog.Disposable}
|
* @extends {goog.Disposable}
|
||||||
* @param {ol.control.ControlOptions} controlOptions Control options.
|
* @param {ol.control.ControlOptions} options Control options.
|
||||||
*/
|
*/
|
||||||
ol.control.Control = function(controlOptions) {
|
ol.control.Control = function(options) {
|
||||||
|
|
||||||
goog.base(this);
|
goog.base(this);
|
||||||
|
|
||||||
@@ -33,14 +33,13 @@ ol.control.Control = function(controlOptions) {
|
|||||||
* @protected
|
* @protected
|
||||||
* @type {Element}
|
* @type {Element}
|
||||||
*/
|
*/
|
||||||
this.element = goog.isDef(controlOptions.element) ?
|
this.element = goog.isDef(options.element) ? options.element : null;
|
||||||
controlOptions.element : null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Element|undefined}
|
* @type {Element|undefined}
|
||||||
*/
|
*/
|
||||||
this.target_ = controlOptions.target;
|
this.target_ = options.target;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
@@ -54,8 +53,8 @@ ol.control.Control = function(controlOptions) {
|
|||||||
*/
|
*/
|
||||||
this.listenerKeys = [];
|
this.listenerKeys = [];
|
||||||
|
|
||||||
if (goog.isDef(controlOptions.map)) {
|
if (goog.isDef(options.map)) {
|
||||||
this.setMap(controlOptions.map);
|
this.setMap(options.map);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ goog.require('ol.control.Zoom');
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.control.DefaultsOptions=} opt_options Options.
|
* @param {ol.control.DefaultsOptions=} opt_options Defaults options.
|
||||||
* @param {Array.<ol.control.Control>=} opt_controls Additional controls.
|
* @param {Array.<ol.control.Control>=} opt_controls Additional controls.
|
||||||
* @return {Array.<ol.control.Control>} Controls.
|
* @return {Array.<ol.control.Control>} Controls.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ ol.control.DragBoxOptions;
|
|||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.control.Control}
|
* @extends {ol.control.Control}
|
||||||
* @param {ol.control.DragBoxOptions} dragBoxOptions Drag box options.
|
* @param {ol.control.DragBoxOptions} options Drag box options.
|
||||||
*/
|
*/
|
||||||
ol.control.DragBox = function(dragBoxOptions) {
|
ol.control.DragBox = function(options) {
|
||||||
|
|
||||||
var element = goog.dom.createDom(goog.dom.TagName.DIV, 'ol-dragbox');
|
var element = goog.dom.createDom(goog.dom.TagName.DIV, 'ol-dragbox');
|
||||||
|
|
||||||
@@ -40,11 +40,11 @@ ol.control.DragBox = function(dragBoxOptions) {
|
|||||||
* @private
|
* @private
|
||||||
* @type {ol.Coordinate}
|
* @type {ol.Coordinate}
|
||||||
*/
|
*/
|
||||||
this.startCoordinate_ = dragBoxOptions.startCoordinate;
|
this.startCoordinate_ = options.startCoordinate;
|
||||||
|
|
||||||
goog.base(this, {
|
goog.base(this, {
|
||||||
element: element,
|
element: element,
|
||||||
map: dragBoxOptions.map
|
map: options.map
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ goog.require('ol.css');
|
|||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.control.Control}
|
* @extends {ol.control.Control}
|
||||||
* @param {ol.control.LogoOptions=} opt_options Options.
|
* @param {ol.control.LogoOptions=} opt_options Logo options.
|
||||||
*/
|
*/
|
||||||
ol.control.Logo = function(opt_options) {
|
ol.control.Logo = function(opt_options) {
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ goog.require('ol.projection');
|
|||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.control.Control}
|
* @extends {ol.control.Control}
|
||||||
* @param {ol.control.MousePositionOptions=} opt_options Options.
|
* @param {ol.control.MousePositionOptions=} opt_options Mouse position options.
|
||||||
*/
|
*/
|
||||||
ol.control.MousePosition = function(opt_options) {
|
ol.control.MousePosition = function(opt_options) {
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ ol.control.ScaleLineUnits = {
|
|||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.control.Control}
|
* @extends {ol.control.Control}
|
||||||
* @param {ol.control.ScaleLineOptions=} opt_options Options.
|
* @param {ol.control.ScaleLineOptions=} opt_options Scale line options.
|
||||||
*/
|
*/
|
||||||
ol.control.ScaleLine = function(opt_options) {
|
ol.control.ScaleLine = function(opt_options) {
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ ol.control.ZOOM_DURATION = 250;
|
|||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.control.Control}
|
* @extends {ol.control.Control}
|
||||||
* @param {ol.control.ZoomOptions=} opt_options Options.
|
* @param {ol.control.ZoomOptions=} opt_options Zoom options.
|
||||||
*/
|
*/
|
||||||
ol.control.Zoom = function(opt_options) {
|
ol.control.Zoom = function(opt_options) {
|
||||||
|
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ goog.require('ol.css');
|
|||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.control.Control}
|
* @extends {ol.control.Control}
|
||||||
* @param {ol.control.ZoomSliderOptions} zoomSliderOptions Zoom options.
|
* @param {ol.control.ZoomSliderOptions} options Zoom slider options.
|
||||||
*/
|
*/
|
||||||
ol.control.ZoomSlider = function(zoomSliderOptions) {
|
ol.control.ZoomSlider = function(options) {
|
||||||
// FIXME these should be read out from a map if not given, and only then
|
// FIXME these should be read out from a map if not given, and only then
|
||||||
// fallback to the constants if they weren't defined on the map.
|
// fallback to the constants if they weren't defined on the map.
|
||||||
/**
|
/**
|
||||||
@@ -34,9 +34,8 @@ ol.control.ZoomSlider = function(zoomSliderOptions) {
|
|||||||
* @type {number}
|
* @type {number}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.maxResolution_ = goog.isDef(zoomSliderOptions.maxResolution) ?
|
this.maxResolution_ = goog.isDef(options.maxResolution) ?
|
||||||
zoomSliderOptions.maxResolution :
|
options.maxResolution : ol.control.ZoomSlider.DEFAULT_MAX_RESOLUTION;
|
||||||
ol.control.ZoomSlider.DEFAULT_MAX_RESOLUTION;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The maximum resolution that one can set with this control.
|
* The maximum resolution that one can set with this control.
|
||||||
@@ -44,9 +43,8 @@ ol.control.ZoomSlider = function(zoomSliderOptions) {
|
|||||||
* @type {number}
|
* @type {number}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.minResolution_ = goog.isDef(zoomSliderOptions.minResolution) ?
|
this.minResolution_ = goog.isDef(options.minResolution) ?
|
||||||
zoomSliderOptions.minResolution :
|
options.minResolution : ol.control.ZoomSlider.DEFAULT_MIN_RESOLUTION;
|
||||||
ol.control.ZoomSlider.DEFAULT_MIN_RESOLUTION;
|
|
||||||
|
|
||||||
goog.asserts.assert(
|
goog.asserts.assert(
|
||||||
this.minResolution_ < this.maxResolution_,
|
this.minResolution_ < this.maxResolution_,
|
||||||
@@ -95,7 +93,7 @@ ol.control.ZoomSlider = function(zoomSliderOptions) {
|
|||||||
|
|
||||||
goog.base(this, {
|
goog.base(this, {
|
||||||
element: elem,
|
element: elem,
|
||||||
map: zoomSliderOptions.map
|
map: options.map
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
goog.inherits(ol.control.ZoomSlider, ol.control.Control);
|
goog.inherits(ol.control.ZoomSlider, ol.control.Control);
|
||||||
|
|||||||
Reference in New Issue
Block a user