Merge pull request #7770 from marcjansen/more-renames
Rename _ol_render_Box_ to RenderBox
This commit is contained in:
@@ -6,7 +6,7 @@ import Event from '../events/Event.js';
|
|||||||
import {inherits, nullFunction} from '../index.js';
|
import {inherits, nullFunction} from '../index.js';
|
||||||
import {always, mouseOnly, mouseActionButton} from '../events/condition.js';
|
import {always, mouseOnly, mouseActionButton} from '../events/condition.js';
|
||||||
import PointerInteraction from '../interaction/Pointer.js';
|
import PointerInteraction from '../interaction/Pointer.js';
|
||||||
import _ol_render_Box_ from '../render/Box.js';
|
import RenderBox from '../render/Box.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
@@ -39,7 +39,7 @@ const DragBox = function(opt_options) {
|
|||||||
* @type {ol.render.Box}
|
* @type {ol.render.Box}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.box_ = new _ol_render_Box_(options.className || 'ol-dragbox');
|
this.box_ = new RenderBox(options.className || 'ol-dragbox');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import Polygon from '../geom/Polygon.js';
|
|||||||
* @extends {ol.Disposable}
|
* @extends {ol.Disposable}
|
||||||
* @param {string} className CSS class name.
|
* @param {string} className CSS class name.
|
||||||
*/
|
*/
|
||||||
const _ol_render_Box_ = function(className) {
|
const RenderBox = function(className) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {ol.geom.Polygon}
|
* @type {ol.geom.Polygon}
|
||||||
@@ -48,13 +48,13 @@ const _ol_render_Box_ = function(className) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_render_Box_, Disposable);
|
inherits(RenderBox, Disposable);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_render_Box_.prototype.disposeInternal = function() {
|
RenderBox.prototype.disposeInternal = function() {
|
||||||
this.setMap(null);
|
this.setMap(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ _ol_render_Box_.prototype.disposeInternal = function() {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_ol_render_Box_.prototype.render_ = function() {
|
RenderBox.prototype.render_ = function() {
|
||||||
const startPixel = this.startPixel_;
|
const startPixel = this.startPixel_;
|
||||||
const endPixel = this.endPixel_;
|
const endPixel = this.endPixel_;
|
||||||
const px = 'px';
|
const px = 'px';
|
||||||
@@ -77,7 +77,7 @@ _ol_render_Box_.prototype.render_ = function() {
|
|||||||
/**
|
/**
|
||||||
* @param {ol.PluggableMap} map Map.
|
* @param {ol.PluggableMap} map Map.
|
||||||
*/
|
*/
|
||||||
_ol_render_Box_.prototype.setMap = function(map) {
|
RenderBox.prototype.setMap = function(map) {
|
||||||
if (this.map_) {
|
if (this.map_) {
|
||||||
this.map_.getOverlayContainer().removeChild(this.element_);
|
this.map_.getOverlayContainer().removeChild(this.element_);
|
||||||
const style = this.element_.style;
|
const style = this.element_.style;
|
||||||
@@ -94,7 +94,7 @@ _ol_render_Box_.prototype.setMap = function(map) {
|
|||||||
* @param {ol.Pixel} startPixel Start pixel.
|
* @param {ol.Pixel} startPixel Start pixel.
|
||||||
* @param {ol.Pixel} endPixel End pixel.
|
* @param {ol.Pixel} endPixel End pixel.
|
||||||
*/
|
*/
|
||||||
_ol_render_Box_.prototype.setPixels = function(startPixel, endPixel) {
|
RenderBox.prototype.setPixels = function(startPixel, endPixel) {
|
||||||
this.startPixel_ = startPixel;
|
this.startPixel_ = startPixel;
|
||||||
this.endPixel_ = endPixel;
|
this.endPixel_ = endPixel;
|
||||||
this.createOrUpdateGeometry();
|
this.createOrUpdateGeometry();
|
||||||
@@ -105,7 +105,7 @@ _ol_render_Box_.prototype.setPixels = function(startPixel, endPixel) {
|
|||||||
/**
|
/**
|
||||||
* Creates or updates the cached geometry.
|
* Creates or updates the cached geometry.
|
||||||
*/
|
*/
|
||||||
_ol_render_Box_.prototype.createOrUpdateGeometry = function() {
|
RenderBox.prototype.createOrUpdateGeometry = function() {
|
||||||
const startPixel = this.startPixel_;
|
const startPixel = this.startPixel_;
|
||||||
const endPixel = this.endPixel_;
|
const endPixel = this.endPixel_;
|
||||||
const pixels = [
|
const pixels = [
|
||||||
@@ -128,7 +128,7 @@ _ol_render_Box_.prototype.createOrUpdateGeometry = function() {
|
|||||||
/**
|
/**
|
||||||
* @return {ol.geom.Polygon} Geometry.
|
* @return {ol.geom.Polygon} Geometry.
|
||||||
*/
|
*/
|
||||||
_ol_render_Box_.prototype.getGeometry = function() {
|
RenderBox.prototype.getGeometry = function() {
|
||||||
return this.geometry_;
|
return this.geometry_;
|
||||||
};
|
};
|
||||||
export default _ol_render_Box_;
|
export default RenderBox;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
|||||||
import {fromExtent as polygonFromExtent} from '../../../../src/ol/geom/Polygon.js';
|
import {fromExtent as polygonFromExtent} from '../../../../src/ol/geom/Polygon.js';
|
||||||
import DragZoom from '../../../../src/ol/interaction/DragZoom.js';
|
import DragZoom from '../../../../src/ol/interaction/DragZoom.js';
|
||||||
import VectorLayer from '../../../../src/ol/layer/Vector.js';
|
import VectorLayer from '../../../../src/ol/layer/Vector.js';
|
||||||
import _ol_render_Box_ from '../../../../src/ol/render/Box.js';
|
import RenderBox from '../../../../src/ol/render/Box.js';
|
||||||
import VectorSource from '../../../../src/ol/source/Vector.js';
|
import VectorSource from '../../../../src/ol/source/Vector.js';
|
||||||
|
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ describe('ol.interaction.DragZoom', function() {
|
|||||||
});
|
});
|
||||||
map.addInteraction(interaction);
|
map.addInteraction(interaction);
|
||||||
|
|
||||||
const box = new _ol_render_Box_();
|
const box = new RenderBox();
|
||||||
const extent = [-110, 40, -90, 60];
|
const extent = [-110, 40, -90, 60];
|
||||||
box.geometry_ = polygonFromExtent(extent);
|
box.geometry_ = polygonFromExtent(extent);
|
||||||
interaction.box_ = box;
|
interaction.box_ = box;
|
||||||
@@ -92,7 +92,7 @@ describe('ol.interaction.DragZoom', function() {
|
|||||||
});
|
});
|
||||||
map.addInteraction(interaction);
|
map.addInteraction(interaction);
|
||||||
|
|
||||||
const box = new _ol_render_Box_();
|
const box = new RenderBox();
|
||||||
const extent = [-11.25, -11.25, 11.25, 11.25];
|
const extent = [-11.25, -11.25, 11.25, 11.25];
|
||||||
box.geometry_ = polygonFromExtent(extent);
|
box.geometry_ = polygonFromExtent(extent);
|
||||||
interaction.box_ = box;
|
interaction.box_ = box;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import Disposable from '../../../../src/ol/Disposable.js';
|
|||||||
import Map from '../../../../src/ol/Map.js';
|
import Map from '../../../../src/ol/Map.js';
|
||||||
import View from '../../../../src/ol/View.js';
|
import View from '../../../../src/ol/View.js';
|
||||||
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_render_Box_ from '../../../../src/ol/render/Box.js';
|
import RenderBox from '../../../../src/ol/render/Box.js';
|
||||||
|
|
||||||
|
|
||||||
describe('ol.render.Box', function() {
|
describe('ol.render.Box', function() {
|
||||||
@@ -10,7 +10,7 @@ describe('ol.render.Box', function() {
|
|||||||
let box, map, target;
|
let box, map, target;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
box = new _ol_render_Box_('test-box');
|
box = new RenderBox('test-box');
|
||||||
|
|
||||||
target = document.createElement('div');
|
target = document.createElement('div');
|
||||||
document.body.appendChild(target);
|
document.body.appendChild(target);
|
||||||
@@ -33,8 +33,8 @@ describe('ol.render.Box', function() {
|
|||||||
|
|
||||||
describe('constructor', function() {
|
describe('constructor', function() {
|
||||||
it('creates an instance', function() {
|
it('creates an instance', function() {
|
||||||
const obj = new _ol_render_Box_('test-box');
|
const obj = new RenderBox('test-box');
|
||||||
expect(obj).to.be.a(_ol_render_Box_);
|
expect(obj).to.be.a(RenderBox);
|
||||||
expect(obj).to.be.a(Disposable);
|
expect(obj).to.be.a(Disposable);
|
||||||
obj.dispose();
|
obj.dispose();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user