Remove map from control options

This commit is contained in:
Tim Schaub
2013-08-30 14:59:21 -06:00
parent 29317c3316
commit b479909e25
13 changed files with 6 additions and 31 deletions

View File

@@ -50,7 +50,6 @@ app.RotateNorthControl = function(opt_options) {
ol.control.Control.call(this, {
element: element,
map: options.map,
target: options.target
});

View File

@@ -152,14 +152,12 @@
/**
* @typedef {Object} ol.control.AttributionOptions
* @property {string|undefined} className CSS class name. Default is 'ol-attribution'.
* @property {ol.Map|undefined} map Map.
* @property {Element|undefined} target Target.
*/
/**
* @typedef {Object} ol.control.ControlOptions
* @property {Element|undefined} element Element.
* @property {ol.Map|undefined} map Map.
* @property {Element|undefined} target Target.
*/
@@ -178,14 +176,12 @@
* @typedef {Object} ol.control.FullScreenOptions
* @property {string|undefined} className CSS class name. Default is 'ol-full-screen'.
* @property {boolean|undefined} keys Full keyboard access.
* @property {ol.Map|undefined} map Map.
* @property {Element|undefined} target Target.
*/
/**
* @typedef {Object} ol.control.LogoOptions
* @property {string|undefined} className CSS class name. Default is 'ol-logo'.
* @property {ol.Map|undefined} map Map.
* @property {Element|undefined} target Target.
*/
@@ -194,7 +190,6 @@
* @property {string|undefined} className CSS class name. Default is 'ol-mouse-position'.
* @property {ol.CoordinateFormatType|undefined} coordinateFormat Coordinate
* format.
* @property {ol.Map|undefined} map Map.
* @property {ol.ProjectionLike} projection Projection.
* @property {Element|undefined} target Target.
* @property {string|undefined} undefinedHTML Markup for undefined coordinates.
@@ -204,7 +199,6 @@
/**
* @typedef {Object} ol.control.ScaleLineOptions
* @property {string|undefined} className CSS Class name. Default is 'ol-scale-line'.
* @property {ol.Map|undefined} map Map.
* @property {number|undefined} minWidth Minimum width in pixels.
* @property {Element|undefined} target Target.
* @property {ol.control.ScaleLineUnits|undefined} units Units.
@@ -214,14 +208,12 @@
* @typedef {Object} ol.control.ZoomOptions
* @property {string|undefined} className CSS class name. Default is 'ol-zoom'.
* @property {number|undefined} delta The zoom delta applied on each click.
* @property {ol.Map|undefined} map Map.
* @property {Element|undefined} target Target.
*/
/**
* @typedef {Object} ol.control.ZoomSliderOptions
* @property {string|undefined} className CSS class name.
* @property {ol.Map|undefined} map Map.
* @property {number|undefined} maxResolution Maximum resolution.
* @property {number|undefined} minResolution Minimum resolution.
*/
@@ -229,7 +221,6 @@
/**
* @typedef {Object} ol.control.ZoomToExtentOptions
* @property {string|undefined} className Class name.
* @property {ol.Map|undefined} map Map.
* @property {Element|undefined} target Target.
* @property {ol.Extent|undefined} extent The extent to zoom to. If
* undefined the validity extent of the view projection is used.

View File

@@ -41,7 +41,6 @@ ol.control.Attribution = function(opt_options) {
goog.base(this, {
element: element,
map: options.map,
target: options.target
});

View File

@@ -45,10 +45,6 @@ ol.control.Control = function(options) {
*/
this.listenerKeys = [];
if (goog.isDef(options.map)) {
this.setMap(options.map);
}
};
goog.inherits(ol.control.Control, ol.Object);

View File

@@ -14,8 +14,7 @@ goog.require('ol.control.Control');
/**
* @typedef {{map: (ol.Map|undefined),
* startCoordinate: ol.Coordinate}}
* @typedef {{startCoordinate: ol.Coordinate}}
*/
ol.control.DragBoxOptions;
@@ -43,8 +42,7 @@ ol.control.DragBox = function(options) {
this.startCoordinate_ = options.startCoordinate;
goog.base(this, {
element: element,
map: options.map
element: element
});
};

View File

@@ -59,7 +59,6 @@ ol.control.FullScreen = function(opt_options) {
goog.base(this, {
element: element,
map: options.map,
target: options.target
});

View File

@@ -37,7 +37,6 @@ ol.control.Logo = function(opt_options) {
goog.base(this, {
element: element,
map: options.map,
target: options.target
});

View File

@@ -59,7 +59,6 @@ ol.control.MousePosition = function(opt_options) {
goog.base(this, {
element: element,
map: options.map,
target: options.target
});

View File

@@ -118,7 +118,6 @@ ol.control.ScaleLine = function(opt_options) {
goog.base(this, {
element: this.element_,
map: options.map,
target: options.target
});

View File

@@ -59,7 +59,6 @@ ol.control.Zoom = function(opt_options) {
goog.base(this, {
element: element,
map: options.map,
target: options.target
});

View File

@@ -91,8 +91,7 @@ ol.control.ZoomSlider = function(opt_options) {
], this.handleContainerClick_, false, this);
goog.base(this, {
element: element,
map: options.map
element: element
});
};
goog.inherits(ol.control.ZoomSlider, ol.control.Control);

View File

@@ -46,7 +46,6 @@ ol.control.ZoomToExtent = function(opt_options) {
goog.base(this, {
element: element,
map: options.map,
target: options.target
});
};

View File

@@ -6,11 +6,10 @@ describe('ol.control.ZoomSlider', function() {
beforeEach(function() {
target = document.createElement('div');
document.body.appendChild(target);
zoomslider = new ol.control.ZoomSlider();
map = new ol.Map({
target: target
});
zoomslider = new ol.control.ZoomSlider({
map: map
target: target,
controls: [zoomslider]
});
});