Be more consistent with control options
This commit is contained in:
@@ -20,7 +20,7 @@ goog.require('ol.source.Source');
|
||||
/**
|
||||
* @constructor
|
||||
* @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) {
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@ ol.control.ControlOptions;
|
||||
*
|
||||
* @constructor
|
||||
* @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);
|
||||
|
||||
@@ -33,14 +33,13 @@ ol.control.Control = function(controlOptions) {
|
||||
* @protected
|
||||
* @type {Element}
|
||||
*/
|
||||
this.element = goog.isDef(controlOptions.element) ?
|
||||
controlOptions.element : null;
|
||||
this.element = goog.isDef(options.element) ? options.element : null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Element|undefined}
|
||||
*/
|
||||
this.target_ = controlOptions.target;
|
||||
this.target_ = options.target;
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -54,8 +53,8 @@ ol.control.Control = function(controlOptions) {
|
||||
*/
|
||||
this.listenerKeys = [];
|
||||
|
||||
if (goog.isDef(controlOptions.map)) {
|
||||
this.setMap(controlOptions.map);
|
||||
if (goog.isDef(options.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.
|
||||
* @return {Array.<ol.control.Control>} Controls.
|
||||
*/
|
||||
|
||||
@@ -24,9 +24,9 @@ ol.control.DragBoxOptions;
|
||||
/**
|
||||
* @constructor
|
||||
* @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');
|
||||
|
||||
@@ -40,11 +40,11 @@ ol.control.DragBox = function(dragBoxOptions) {
|
||||
* @private
|
||||
* @type {ol.Coordinate}
|
||||
*/
|
||||
this.startCoordinate_ = dragBoxOptions.startCoordinate;
|
||||
this.startCoordinate_ = options.startCoordinate;
|
||||
|
||||
goog.base(this, {
|
||||
element: element,
|
||||
map: dragBoxOptions.map
|
||||
map: options.map
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
@@ -13,7 +13,7 @@ goog.require('ol.css');
|
||||
/**
|
||||
* @constructor
|
||||
* @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) {
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ goog.require('ol.projection');
|
||||
/**
|
||||
* @constructor
|
||||
* @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) {
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ ol.control.ScaleLineUnits = {
|
||||
/**
|
||||
* @constructor
|
||||
* @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) {
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ ol.control.ZOOM_DURATION = 250;
|
||||
/**
|
||||
* @constructor
|
||||
* @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) {
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@ goog.require('ol.css');
|
||||
/**
|
||||
* @constructor
|
||||
* @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
|
||||
// fallback to the constants if they weren't defined on the map.
|
||||
/**
|
||||
@@ -34,9 +34,8 @@ ol.control.ZoomSlider = function(zoomSliderOptions) {
|
||||
* @type {number}
|
||||
* @private
|
||||
*/
|
||||
this.maxResolution_ = goog.isDef(zoomSliderOptions.maxResolution) ?
|
||||
zoomSliderOptions.maxResolution :
|
||||
ol.control.ZoomSlider.DEFAULT_MAX_RESOLUTION;
|
||||
this.maxResolution_ = goog.isDef(options.maxResolution) ?
|
||||
options.maxResolution : ol.control.ZoomSlider.DEFAULT_MAX_RESOLUTION;
|
||||
|
||||
/**
|
||||
* The maximum resolution that one can set with this control.
|
||||
@@ -44,9 +43,8 @@ ol.control.ZoomSlider = function(zoomSliderOptions) {
|
||||
* @type {number}
|
||||
* @private
|
||||
*/
|
||||
this.minResolution_ = goog.isDef(zoomSliderOptions.minResolution) ?
|
||||
zoomSliderOptions.minResolution :
|
||||
ol.control.ZoomSlider.DEFAULT_MIN_RESOLUTION;
|
||||
this.minResolution_ = goog.isDef(options.minResolution) ?
|
||||
options.minResolution : ol.control.ZoomSlider.DEFAULT_MIN_RESOLUTION;
|
||||
|
||||
goog.asserts.assert(
|
||||
this.minResolution_ < this.maxResolution_,
|
||||
@@ -95,7 +93,7 @@ ol.control.ZoomSlider = function(zoomSliderOptions) {
|
||||
|
||||
goog.base(this, {
|
||||
element: elem,
|
||||
map: zoomSliderOptions.map
|
||||
map: options.map
|
||||
});
|
||||
};
|
||||
goog.inherits(ol.control.ZoomSlider, ol.control.Control);
|
||||
|
||||
Reference in New Issue
Block a user