Merge pull request #946 from tschaub/control-options
Remove map from ControlOptions.
This commit is contained in:
@@ -41,7 +41,6 @@ ol.control.Attribution = function(opt_options) {
|
||||
|
||||
goog.base(this, {
|
||||
element: element,
|
||||
map: options.map,
|
||||
target: options.target
|
||||
});
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
@@ -51,7 +51,6 @@ ol.control.FullScreen = function(opt_options) {
|
||||
|
||||
goog.base(this, {
|
||||
element: element,
|
||||
map: options.map,
|
||||
target: options.target
|
||||
});
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ ol.control.Logo = function(opt_options) {
|
||||
|
||||
goog.base(this, {
|
||||
element: element,
|
||||
map: options.map,
|
||||
target: options.target
|
||||
});
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ ol.control.MousePosition = function(opt_options) {
|
||||
|
||||
goog.base(this, {
|
||||
element: element,
|
||||
map: options.map,
|
||||
target: options.target
|
||||
});
|
||||
|
||||
|
||||
@@ -108,7 +108,6 @@ ol.control.ScaleLine = function(opt_options) {
|
||||
|
||||
goog.base(this, {
|
||||
element: this.element_,
|
||||
map: options.map,
|
||||
target: options.target
|
||||
});
|
||||
|
||||
|
||||
@@ -59,7 +59,6 @@ ol.control.Zoom = function(opt_options) {
|
||||
|
||||
goog.base(this, {
|
||||
element: element,
|
||||
map: options.map,
|
||||
target: options.target
|
||||
});
|
||||
|
||||
|
||||
@@ -33,9 +33,7 @@ ol.control.ZOOMSLIDER_ANIMATION_DURATION = 200;
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* var zoomslider = new ol.control.ZoomSlider({
|
||||
* map: map
|
||||
* });
|
||||
* map.addControl(new ol.control.ZoomSlider());
|
||||
*
|
||||
* @constructor
|
||||
* @extends {ol.control.Control}
|
||||
@@ -91,8 +89,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);
|
||||
|
||||
@@ -46,7 +46,6 @@ ol.control.ZoomToExtent = function(opt_options) {
|
||||
|
||||
goog.base(this, {
|
||||
element: element,
|
||||
map: options.map,
|
||||
target: options.target
|
||||
});
|
||||
};
|
||||
|
||||
@@ -90,9 +90,9 @@ ol.interaction.DragZoom.prototype.handleDragStart =
|
||||
var browserEvent = mapBrowserEvent.browserEvent;
|
||||
if (browserEvent.isMouseActionButton() && this.condition_(browserEvent)) {
|
||||
this.dragBox_ = new ol.control.DragBox({
|
||||
map: mapBrowserEvent.map,
|
||||
startCoordinate: this.startCoordinate
|
||||
});
|
||||
this.dragBox_.setMap(mapBrowserEvent.map);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user