Rename _ol_render_Box_ to RenderBox

This commit is contained in:
Marc Jansen
2018-02-06 06:39:15 +01:00
parent 5d62a89999
commit 3fee998108
4 changed files with 18 additions and 18 deletions

View File

@@ -6,7 +6,7 @@ import Event from '../events/Event.js';
import {inherits, nullFunction} from '../index.js';
import {always, mouseOnly, mouseActionButton} from '../events/condition.js';
import PointerInteraction from '../interaction/Pointer.js';
import _ol_render_Box_ from '../render/Box.js';
import RenderBox from '../render/Box.js';
/**
* @classdesc
@@ -39,7 +39,7 @@ const DragBox = function(opt_options) {
* @type {ol.render.Box}
* @private
*/
this.box_ = new _ol_render_Box_(options.className || 'ol-dragbox');
this.box_ = new RenderBox(options.className || 'ol-dragbox');
/**
* @type {number}

View File

@@ -12,7 +12,7 @@ import Polygon from '../geom/Polygon.js';
* @extends {ol.Disposable}
* @param {string} className CSS class name.
*/
const _ol_render_Box_ = function(className) {
const RenderBox = function(className) {
/**
* @type {ol.geom.Polygon}
@@ -48,13 +48,13 @@ const _ol_render_Box_ = function(className) {
};
inherits(_ol_render_Box_, Disposable);
inherits(RenderBox, Disposable);
/**
* @inheritDoc
*/
_ol_render_Box_.prototype.disposeInternal = function() {
RenderBox.prototype.disposeInternal = function() {
this.setMap(null);
};
@@ -62,7 +62,7 @@ _ol_render_Box_.prototype.disposeInternal = function() {
/**
* @private
*/
_ol_render_Box_.prototype.render_ = function() {
RenderBox.prototype.render_ = function() {
const startPixel = this.startPixel_;
const endPixel = this.endPixel_;
const px = 'px';
@@ -77,7 +77,7 @@ _ol_render_Box_.prototype.render_ = function() {
/**
* @param {ol.PluggableMap} map Map.
*/
_ol_render_Box_.prototype.setMap = function(map) {
RenderBox.prototype.setMap = function(map) {
if (this.map_) {
this.map_.getOverlayContainer().removeChild(this.element_);
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} endPixel End pixel.
*/
_ol_render_Box_.prototype.setPixels = function(startPixel, endPixel) {
RenderBox.prototype.setPixels = function(startPixel, endPixel) {
this.startPixel_ = startPixel;
this.endPixel_ = endPixel;
this.createOrUpdateGeometry();
@@ -105,7 +105,7 @@ _ol_render_Box_.prototype.setPixels = function(startPixel, endPixel) {
/**
* Creates or updates the cached geometry.
*/
_ol_render_Box_.prototype.createOrUpdateGeometry = function() {
RenderBox.prototype.createOrUpdateGeometry = function() {
const startPixel = this.startPixel_;
const endPixel = this.endPixel_;
const pixels = [
@@ -128,7 +128,7 @@ _ol_render_Box_.prototype.createOrUpdateGeometry = function() {
/**
* @return {ol.geom.Polygon} Geometry.
*/
_ol_render_Box_.prototype.getGeometry = function() {
RenderBox.prototype.getGeometry = function() {
return this.geometry_;
};
export default _ol_render_Box_;
export default RenderBox;

View File

@@ -4,7 +4,7 @@ import * as _ol_extent_ from '../../../../src/ol/extent.js';
import {fromExtent as polygonFromExtent} from '../../../../src/ol/geom/Polygon.js';
import DragZoom from '../../../../src/ol/interaction/DragZoom.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';
@@ -70,7 +70,7 @@ describe('ol.interaction.DragZoom', function() {
});
map.addInteraction(interaction);
const box = new _ol_render_Box_();
const box = new RenderBox();
const extent = [-110, 40, -90, 60];
box.geometry_ = polygonFromExtent(extent);
interaction.box_ = box;
@@ -92,7 +92,7 @@ describe('ol.interaction.DragZoom', function() {
});
map.addInteraction(interaction);
const box = new _ol_render_Box_();
const box = new RenderBox();
const extent = [-11.25, -11.25, 11.25, 11.25];
box.geometry_ = polygonFromExtent(extent);
interaction.box_ = box;

View File

@@ -2,7 +2,7 @@ import Disposable from '../../../../src/ol/Disposable.js';
import Map from '../../../../src/ol/Map.js';
import View from '../../../../src/ol/View.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() {
@@ -10,7 +10,7 @@ describe('ol.render.Box', function() {
let box, map, target;
beforeEach(function() {
box = new _ol_render_Box_('test-box');
box = new RenderBox('test-box');
target = document.createElement('div');
document.body.appendChild(target);
@@ -33,8 +33,8 @@ describe('ol.render.Box', function() {
describe('constructor', function() {
it('creates an instance', function() {
const obj = new _ol_render_Box_('test-box');
expect(obj).to.be.a(_ol_render_Box_);
const obj = new RenderBox('test-box');
expect(obj).to.be.a(RenderBox);
expect(obj).to.be.a(Disposable);
obj.dispose();
});