Rename _ol_control_Control_ to Control
This commit is contained in:
@@ -2,7 +2,7 @@ import {inherits} from '../src/ol/index.js';
|
|||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_control_ from '../src/ol/control.js';
|
import _ol_control_ from '../src/ol/control.js';
|
||||||
import _ol_control_Control_ from '../src/ol/control/Control.js';
|
import Control from '../src/ol/control/Control.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
||||||
|
|
||||||
@@ -43,13 +43,13 @@ app.RotateNorthControl = function(opt_options) {
|
|||||||
element.className = 'rotate-north ol-unselectable ol-control';
|
element.className = 'rotate-north ol-unselectable ol-control';
|
||||||
element.appendChild(button);
|
element.appendChild(button);
|
||||||
|
|
||||||
_ol_control_Control_.call(this, {
|
Control.call(this, {
|
||||||
element: element,
|
element: element,
|
||||||
target: options.target
|
target: options.target
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
inherits(app.RotateNorthControl, _ol_control_Control_);
|
inherits(app.RotateNorthControl, Control);
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_array_ from '../array.js';
|
import _ol_array_ from '../array.js';
|
||||||
import _ol_control_Control_ from '../control/Control.js';
|
import Control from '../control/Control.js';
|
||||||
import _ol_css_ from '../css.js';
|
import _ol_css_ from '../css.js';
|
||||||
import {removeNode, replaceNode} from '../dom.js';
|
import {removeNode, replaceNode} from '../dom.js';
|
||||||
import _ol_events_ from '../events.js';
|
import _ol_events_ from '../events.js';
|
||||||
@@ -112,7 +112,7 @@ var Attribution = function(opt_options) {
|
|||||||
|
|
||||||
var render = options.render ? options.render : Attribution.render;
|
var render = options.render ? options.render : Attribution.render;
|
||||||
|
|
||||||
_ol_control_Control_.call(this, {
|
Control.call(this, {
|
||||||
element: element,
|
element: element,
|
||||||
render: render,
|
render: render,
|
||||||
target: options.target
|
target: options.target
|
||||||
@@ -139,7 +139,7 @@ var Attribution = function(opt_options) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(Attribution, _ol_control_Control_);
|
inherits(Attribution, Control);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import _ol_events_ from '../events.js';
|
|||||||
* @param {olx.control.ControlOptions} options Control options.
|
* @param {olx.control.ControlOptions} options Control options.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
var _ol_control_Control_ = function(options) {
|
var Control = function(options) {
|
||||||
|
|
||||||
_ol_Object_.call(this);
|
_ol_Object_.call(this);
|
||||||
|
|
||||||
@@ -75,13 +75,13 @@ var _ol_control_Control_ = function(options) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_control_Control_, _ol_Object_);
|
inherits(Control, _ol_Object_);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_control_Control_.prototype.disposeInternal = function() {
|
Control.prototype.disposeInternal = function() {
|
||||||
removeNode(this.element);
|
removeNode(this.element);
|
||||||
_ol_Object_.prototype.disposeInternal.call(this);
|
_ol_Object_.prototype.disposeInternal.call(this);
|
||||||
};
|
};
|
||||||
@@ -92,7 +92,7 @@ _ol_control_Control_.prototype.disposeInternal = function() {
|
|||||||
* @return {ol.PluggableMap} Map.
|
* @return {ol.PluggableMap} Map.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_control_Control_.prototype.getMap = function() {
|
Control.prototype.getMap = function() {
|
||||||
return this.map_;
|
return this.map_;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ _ol_control_Control_.prototype.getMap = function() {
|
|||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_control_Control_.prototype.setMap = function(map) {
|
Control.prototype.setMap = function(map) {
|
||||||
if (this.map_) {
|
if (this.map_) {
|
||||||
removeNode(this.element);
|
removeNode(this.element);
|
||||||
}
|
}
|
||||||
@@ -136,9 +136,9 @@ _ol_control_Control_.prototype.setMap = function(map) {
|
|||||||
* @param {Element|string} target Target.
|
* @param {Element|string} target Target.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_control_Control_.prototype.setTarget = function(target) {
|
Control.prototype.setTarget = function(target) {
|
||||||
this.target_ = typeof target === 'string' ?
|
this.target_ = typeof target === 'string' ?
|
||||||
document.getElementById(target) :
|
document.getElementById(target) :
|
||||||
target;
|
target;
|
||||||
};
|
};
|
||||||
export default _ol_control_Control_;
|
export default Control;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @module ol/control/FullScreen
|
* @module ol/control/FullScreen
|
||||||
*/
|
*/
|
||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_control_Control_ from '../control/Control.js';
|
import Control from '../control/Control.js';
|
||||||
import _ol_css_ from '../css.js';
|
import _ol_css_ from '../css.js';
|
||||||
import {replaceNode} from '../dom.js';
|
import {replaceNode} from '../dom.js';
|
||||||
import _ol_events_ from '../events.js';
|
import _ol_events_ from '../events.js';
|
||||||
@@ -71,7 +71,7 @@ var _ol_control_FullScreen_ = function(opt_options) {
|
|||||||
element.className = cssClasses;
|
element.className = cssClasses;
|
||||||
element.appendChild(button);
|
element.appendChild(button);
|
||||||
|
|
||||||
_ol_control_Control_.call(this, {
|
Control.call(this, {
|
||||||
element: element,
|
element: element,
|
||||||
target: options.target
|
target: options.target
|
||||||
});
|
});
|
||||||
@@ -90,7 +90,7 @@ var _ol_control_FullScreen_ = function(opt_options) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_control_FullScreen_, _ol_control_Control_);
|
inherits(_ol_control_FullScreen_, Control);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -159,7 +159,7 @@ _ol_control_FullScreen_.prototype.handleFullScreenChange_ = function() {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_control_FullScreen_.prototype.setMap = function(map) {
|
_ol_control_FullScreen_.prototype.setMap = function(map) {
|
||||||
_ol_control_Control_.prototype.setMap.call(this, map);
|
Control.prototype.setMap.call(this, map);
|
||||||
if (map) {
|
if (map) {
|
||||||
this.listenerKeys.push(_ol_events_.listen(document,
|
this.listenerKeys.push(_ol_events_.listen(document,
|
||||||
_ol_control_FullScreen_.getChangeType_(),
|
_ol_control_FullScreen_.getChangeType_(),
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {inherits} from '../index.js';
|
|||||||
import _ol_events_ from '../events.js';
|
import _ol_events_ from '../events.js';
|
||||||
import _ol_events_EventType_ from '../events/EventType.js';
|
import _ol_events_EventType_ from '../events/EventType.js';
|
||||||
import _ol_Object_ from '../Object.js';
|
import _ol_Object_ from '../Object.js';
|
||||||
import _ol_control_Control_ from '../control/Control.js';
|
import Control from '../control/Control.js';
|
||||||
import {getTransformFromProjections, identityTransform, get as getProjection} from '../proj.js';
|
import {getTransformFromProjections, identityTransform, get as getProjection} from '../proj.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -32,7 +32,7 @@ var _ol_control_MousePosition_ = function(opt_options) {
|
|||||||
var render = options.render ?
|
var render = options.render ?
|
||||||
options.render : _ol_control_MousePosition_.render;
|
options.render : _ol_control_MousePosition_.render;
|
||||||
|
|
||||||
_ol_control_Control_.call(this, {
|
Control.call(this, {
|
||||||
element: element,
|
element: element,
|
||||||
render: render,
|
render: render,
|
||||||
target: options.target
|
target: options.target
|
||||||
@@ -81,7 +81,7 @@ var _ol_control_MousePosition_ = function(opt_options) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_control_MousePosition_, _ol_control_Control_);
|
inherits(_ol_control_MousePosition_, Control);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -167,7 +167,7 @@ _ol_control_MousePosition_.prototype.handleMouseOut = function(event) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_control_MousePosition_.prototype.setMap = function(map) {
|
_ol_control_MousePosition_.prototype.setMap = function(map) {
|
||||||
_ol_control_Control_.prototype.setMap.call(this, map);
|
Control.prototype.setMap.call(this, map);
|
||||||
if (map) {
|
if (map) {
|
||||||
var viewport = map.getViewport();
|
var viewport = map.getViewport();
|
||||||
this.listenerKeys.push(
|
this.listenerKeys.push(
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import _ol_ObjectEventType_ from '../ObjectEventType.js';
|
|||||||
import _ol_Overlay_ from '../Overlay.js';
|
import _ol_Overlay_ from '../Overlay.js';
|
||||||
import _ol_OverlayPositioning_ from '../OverlayPositioning.js';
|
import _ol_OverlayPositioning_ from '../OverlayPositioning.js';
|
||||||
import _ol_ViewProperty_ from '../ViewProperty.js';
|
import _ol_ViewProperty_ from '../ViewProperty.js';
|
||||||
import _ol_control_Control_ from '../control/Control.js';
|
import Control from '../control/Control.js';
|
||||||
import _ol_coordinate_ from '../coordinate.js';
|
import _ol_coordinate_ from '../coordinate.js';
|
||||||
import _ol_css_ from '../css.js';
|
import _ol_css_ from '../css.js';
|
||||||
import {replaceNode} from '../dom.js';
|
import {replaceNode} from '../dom.js';
|
||||||
@@ -158,7 +158,7 @@ var _ol_control_OverviewMap_ = function(opt_options) {
|
|||||||
|
|
||||||
var render = options.render ? options.render : _ol_control_OverviewMap_.render;
|
var render = options.render ? options.render : _ol_control_OverviewMap_.render;
|
||||||
|
|
||||||
_ol_control_Control_.call(this, {
|
Control.call(this, {
|
||||||
element: element,
|
element: element,
|
||||||
render: render,
|
render: render,
|
||||||
target: options.target
|
target: options.target
|
||||||
@@ -203,7 +203,7 @@ var _ol_control_OverviewMap_ = function(opt_options) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_control_OverviewMap_, _ol_control_Control_);
|
inherits(_ol_control_OverviewMap_, Control);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -222,7 +222,7 @@ _ol_control_OverviewMap_.prototype.setMap = function(map) {
|
|||||||
}
|
}
|
||||||
this.ovmap_.setTarget(null);
|
this.ovmap_.setTarget(null);
|
||||||
}
|
}
|
||||||
_ol_control_Control_.prototype.setMap.call(this, map);
|
Control.prototype.setMap.call(this, map);
|
||||||
|
|
||||||
if (map) {
|
if (map) {
|
||||||
this.ovmap_.setTarget(this.ovmapDiv_);
|
this.ovmap_.setTarget(this.ovmapDiv_);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @module ol/control/Rotate
|
* @module ol/control/Rotate
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import _ol_control_Control_ from '../control/Control.js';
|
import Control from '../control/Control.js';
|
||||||
import _ol_css_ from '../css.js';
|
import _ol_css_ from '../css.js';
|
||||||
import {easeOut} from '../easing.js';
|
import {easeOut} from '../easing.js';
|
||||||
import _ol_events_ from '../events.js';
|
import _ol_events_ from '../events.js';
|
||||||
@@ -64,7 +64,7 @@ var _ol_control_Rotate_ = function(opt_options) {
|
|||||||
|
|
||||||
this.callResetNorth_ = options.resetNorth ? options.resetNorth : undefined;
|
this.callResetNorth_ = options.resetNorth ? options.resetNorth : undefined;
|
||||||
|
|
||||||
_ol_control_Control_.call(this, {
|
Control.call(this, {
|
||||||
element: element,
|
element: element,
|
||||||
render: render,
|
render: render,
|
||||||
target: options.target
|
target: options.target
|
||||||
@@ -94,7 +94,7 @@ var _ol_control_Rotate_ = function(opt_options) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_control_Rotate_, _ol_control_Control_);
|
inherits(_ol_control_Rotate_, Control);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_Object_ from '../Object.js';
|
import _ol_Object_ from '../Object.js';
|
||||||
import _ol_asserts_ from '../asserts.js';
|
import _ol_asserts_ from '../asserts.js';
|
||||||
import _ol_control_Control_ from '../control/Control.js';
|
import Control from '../control/Control.js';
|
||||||
import _ol_control_ScaleLineUnits_ from '../control/ScaleLineUnits.js';
|
import _ol_control_ScaleLineUnits_ from '../control/ScaleLineUnits.js';
|
||||||
import _ol_css_ from '../css.js';
|
import _ol_css_ from '../css.js';
|
||||||
import _ol_events_ from '../events.js';
|
import _ol_events_ from '../events.js';
|
||||||
@@ -79,7 +79,7 @@ var _ol_control_ScaleLine_ = function(opt_options) {
|
|||||||
|
|
||||||
var render = options.render ? options.render : _ol_control_ScaleLine_.render;
|
var render = options.render ? options.render : _ol_control_ScaleLine_.render;
|
||||||
|
|
||||||
_ol_control_Control_.call(this, {
|
Control.call(this, {
|
||||||
element: this.element_,
|
element: this.element_,
|
||||||
render: render,
|
render: render,
|
||||||
target: options.target
|
target: options.target
|
||||||
@@ -94,7 +94,7 @@ var _ol_control_ScaleLine_ = function(opt_options) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_control_ScaleLine_, _ol_control_Control_);
|
inherits(_ol_control_ScaleLine_, Control);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_events_ from '../events.js';
|
import _ol_events_ from '../events.js';
|
||||||
import _ol_events_EventType_ from '../events/EventType.js';
|
import _ol_events_EventType_ from '../events/EventType.js';
|
||||||
import _ol_control_Control_ from '../control/Control.js';
|
import Control from '../control/Control.js';
|
||||||
import _ol_css_ from '../css.js';
|
import _ol_css_ from '../css.js';
|
||||||
import {easeOut} from '../easing.js';
|
import {easeOut} from '../easing.js';
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ var _ol_control_Zoom_ = function(opt_options) {
|
|||||||
element.appendChild(inElement);
|
element.appendChild(inElement);
|
||||||
element.appendChild(outElement);
|
element.appendChild(outElement);
|
||||||
|
|
||||||
_ol_control_Control_.call(this, {
|
Control.call(this, {
|
||||||
element: element,
|
element: element,
|
||||||
target: options.target
|
target: options.target
|
||||||
});
|
});
|
||||||
@@ -77,7 +77,7 @@ var _ol_control_Zoom_ = function(opt_options) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_control_Zoom_, _ol_control_Control_);
|
inherits(_ol_control_Zoom_, Control);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_ViewHint_ from '../ViewHint.js';
|
import _ol_ViewHint_ from '../ViewHint.js';
|
||||||
import _ol_control_Control_ from '../control/Control.js';
|
import Control from '../control/Control.js';
|
||||||
import _ol_css_ from '../css.js';
|
import _ol_css_ from '../css.js';
|
||||||
import {easeOut} from '../easing.js';
|
import {easeOut} from '../easing.js';
|
||||||
import _ol_events_ from '../events.js';
|
import _ol_events_ from '../events.js';
|
||||||
@@ -127,13 +127,13 @@ var _ol_control_ZoomSlider_ = function(opt_options) {
|
|||||||
|
|
||||||
var render = options.render ? options.render : _ol_control_ZoomSlider_.render;
|
var render = options.render ? options.render : _ol_control_ZoomSlider_.render;
|
||||||
|
|
||||||
_ol_control_Control_.call(this, {
|
Control.call(this, {
|
||||||
element: containerElement,
|
element: containerElement,
|
||||||
render: render
|
render: render
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_control_ZoomSlider_, _ol_control_Control_);
|
inherits(_ol_control_ZoomSlider_, Control);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -141,7 +141,7 @@ inherits(_ol_control_ZoomSlider_, _ol_control_Control_);
|
|||||||
*/
|
*/
|
||||||
_ol_control_ZoomSlider_.prototype.disposeInternal = function() {
|
_ol_control_ZoomSlider_.prototype.disposeInternal = function() {
|
||||||
this.dragger_.dispose();
|
this.dragger_.dispose();
|
||||||
_ol_control_Control_.prototype.disposeInternal.call(this);
|
Control.prototype.disposeInternal.call(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -161,7 +161,7 @@ _ol_control_ZoomSlider_.Direction_ = {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_control_ZoomSlider_.prototype.setMap = function(map) {
|
_ol_control_ZoomSlider_.prototype.setMap = function(map) {
|
||||||
_ol_control_Control_.prototype.setMap.call(this, map);
|
Control.prototype.setMap.call(this, map);
|
||||||
if (map) {
|
if (map) {
|
||||||
map.render();
|
map.render();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_events_ from '../events.js';
|
import _ol_events_ from '../events.js';
|
||||||
import _ol_events_EventType_ from '../events/EventType.js';
|
import _ol_events_EventType_ from '../events/EventType.js';
|
||||||
import _ol_control_Control_ from '../control/Control.js';
|
import Control from '../control/Control.js';
|
||||||
import _ol_css_ from '../css.js';
|
import _ol_css_ from '../css.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -48,13 +48,13 @@ var _ol_control_ZoomToExtent_ = function(opt_options) {
|
|||||||
element.className = cssClasses;
|
element.className = cssClasses;
|
||||||
element.appendChild(button);
|
element.appendChild(button);
|
||||||
|
|
||||||
_ol_control_Control_.call(this, {
|
Control.call(this, {
|
||||||
element: element,
|
element: element,
|
||||||
target: options.target
|
target: options.target
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_control_ZoomToExtent_, _ol_control_Control_);
|
inherits(_ol_control_ZoomToExtent_, Control);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ol_Map_ from '../../../../src/ol/Map.js';
|
import _ol_Map_ from '../../../../src/ol/Map.js';
|
||||||
import _ol_control_Control_ from '../../../../src/ol/control/Control.js';
|
import Control from '../../../../src/ol/control/Control.js';
|
||||||
|
|
||||||
describe('ol.control.Control', function() {
|
describe('ol.control.Control', function() {
|
||||||
var map, control;
|
var map, control;
|
||||||
@@ -9,7 +9,7 @@ describe('ol.control.Control', function() {
|
|||||||
target: document.createElement('div')
|
target: document.createElement('div')
|
||||||
});
|
});
|
||||||
var element = document.createElement('DIV');
|
var element = document.createElement('DIV');
|
||||||
control = new _ol_control_Control_({element: element});
|
control = new Control({element: element});
|
||||||
control.setMap(map);
|
control.setMap(map);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ describe('ol.control.Control\'s target', function() {
|
|||||||
var target = document.createElement('div');
|
var target = document.createElement('div');
|
||||||
target.id = 'mycontrol';
|
target.id = 'mycontrol';
|
||||||
document.body.appendChild(target);
|
document.body.appendChild(target);
|
||||||
var ctrl = new _ol_control_Control_({target: 'mycontrol'});
|
var ctrl = new Control({target: 'mycontrol'});
|
||||||
expect(ctrl.target_.id).to.equal('mycontrol');
|
expect(ctrl.target_.id).to.equal('mycontrol');
|
||||||
ctrl.dispose();
|
ctrl.dispose();
|
||||||
target.parentNode.removeChild(target);
|
target.parentNode.removeChild(target);
|
||||||
@@ -42,13 +42,13 @@ describe('ol.control.Control\'s target', function() {
|
|||||||
var target = document.createElement('div');
|
var target = document.createElement('div');
|
||||||
target.id = 'mycontrol';
|
target.id = 'mycontrol';
|
||||||
document.body.appendChild(target);
|
document.body.appendChild(target);
|
||||||
var ctrl = new _ol_control_Control_({target: target});
|
var ctrl = new Control({target: target});
|
||||||
expect(ctrl.target_.id).to.equal('mycontrol');
|
expect(ctrl.target_.id).to.equal('mycontrol');
|
||||||
ctrl.dispose();
|
ctrl.dispose();
|
||||||
target.parentNode.removeChild(target);
|
target.parentNode.removeChild(target);
|
||||||
});
|
});
|
||||||
it('ignores non-existing target id', function() {
|
it('ignores non-existing target id', function() {
|
||||||
var ctrl = new _ol_control_Control_({target: 'doesnotexist'});
|
var ctrl = new Control({target: 'doesnotexist'});
|
||||||
expect(ctrl.target_).to.equal(null);
|
expect(ctrl.target_).to.equal(null);
|
||||||
ctrl.dispose();
|
ctrl.dispose();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import _ol_Map_ from '../../../../src/ol/Map.js';
|
import _ol_Map_ from '../../../../src/ol/Map.js';
|
||||||
import _ol_View_ from '../../../../src/ol/View.js';
|
import _ol_View_ from '../../../../src/ol/View.js';
|
||||||
import _ol_control_Control_ from '../../../../src/ol/control/Control.js';
|
import Control from '../../../../src/ol/control/Control.js';
|
||||||
import _ol_control_OverviewMap_ from '../../../../src/ol/control/OverviewMap.js';
|
import _ol_control_OverviewMap_ from '../../../../src/ol/control/OverviewMap.js';
|
||||||
|
|
||||||
describe('ol.control.OverviewMap', function() {
|
describe('ol.control.OverviewMap', function() {
|
||||||
@@ -25,7 +25,7 @@ describe('ol.control.OverviewMap', function() {
|
|||||||
it('creates an overview map with the default options', function() {
|
it('creates an overview map with the default options', function() {
|
||||||
var control = new _ol_control_OverviewMap_();
|
var control = new _ol_control_OverviewMap_();
|
||||||
expect(control).to.be.a(_ol_control_OverviewMap_);
|
expect(control).to.be.a(_ol_control_OverviewMap_);
|
||||||
expect(control).to.be.a(_ol_control_Control_);
|
expect(control).to.be.a(Control);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user