Call super and fix up comments in render box

This commit is contained in:
Tim Schaub
2018-07-18 00:39:51 -06:00
parent 9ce36da349
commit 5f058e877f
+29 -28
View File
@@ -10,51 +10,52 @@ class RenderBox extends Disposable {
* @param {string} className CSS class name. * @param {string} className CSS class name.
*/ */
constructor(className) { constructor(className) {
super();
/** /**
* @type {module:ol/geom/Polygon} * @type {module:ol/geom/Polygon}
* @private * @private
*/ */
this.geometry_ = null; this.geometry_ = null;
/** /**
* @type {HTMLDivElement} * @type {HTMLDivElement}
* @private * @private
*/ */
this.element_ = /** @type {HTMLDivElement} */ (document.createElement('div')); this.element_ = /** @type {HTMLDivElement} */ (document.createElement('div'));
this.element_.style.position = 'absolute'; this.element_.style.position = 'absolute';
this.element_.className = 'ol-box ' + className; this.element_.className = 'ol-box ' + className;
/** /**
* @private * @private
* @type {module:ol/PluggableMap} * @type {module:ol/PluggableMap}
*/ */
this.map_ = null; this.map_ = null;
/** /**
* @private * @private
* @type {module:ol~Pixel} * @type {module:ol~Pixel}
*/ */
this.startPixel_ = null; this.startPixel_ = null;
/** /**
* @private * @private
* @type {module:ol~Pixel} * @type {module:ol~Pixel}
*/ */
this.endPixel_ = null; this.endPixel_ = null;
} }
/** /**
* @inheritDoc * @inheritDoc
*/ */
disposeInternal() { disposeInternal() {
this.setMap(null); this.setMap(null);
} }
/** /**
* @private * @private
*/ */
render_() { render_() {
const startPixel = this.startPixel_; const startPixel = this.startPixel_;
const endPixel = this.endPixel_; const endPixel = this.endPixel_;
@@ -67,8 +68,8 @@ class RenderBox extends Disposable {
} }
/** /**
* @param {module:ol/PluggableMap} map Map. * @param {module:ol/PluggableMap} map Map.
*/ */
setMap(map) { setMap(map) {
if (this.map_) { if (this.map_) {
this.map_.getOverlayContainer().removeChild(this.element_); this.map_.getOverlayContainer().removeChild(this.element_);
@@ -82,9 +83,9 @@ class RenderBox extends Disposable {
} }
/** /**
* @param {module:ol~Pixel} startPixel Start pixel. * @param {module:ol~Pixel} startPixel Start pixel.
* @param {module:ol~Pixel} endPixel End pixel. * @param {module:ol~Pixel} endPixel End pixel.
*/ */
setPixels(startPixel, endPixel) { setPixels(startPixel, endPixel) {
this.startPixel_ = startPixel; this.startPixel_ = startPixel;
this.endPixel_ = endPixel; this.endPixel_ = endPixel;
@@ -93,8 +94,8 @@ class RenderBox extends Disposable {
} }
/** /**
* Creates or updates the cached geometry. * Creates or updates the cached geometry.
*/ */
createOrUpdateGeometry() { createOrUpdateGeometry() {
const startPixel = this.startPixel_; const startPixel = this.startPixel_;
const endPixel = this.endPixel_; const endPixel = this.endPixel_;
@@ -115,8 +116,8 @@ class RenderBox extends Disposable {
} }
/** /**
* @return {module:ol/geom/Polygon} Geometry. * @return {module:ol/geom/Polygon} Geometry.
*/ */
getGeometry() { getGeometry() {
return this.geometry_; return this.geometry_;
} }