Remove remaining use of inherits in src
This commit is contained in:
+11
-13
@@ -20,21 +20,21 @@ import RegularShape from '../style/RegularShape.js';
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Set circle style for vector features.
|
||||
*
|
||||
* @constructor
|
||||
* @param {module:ol/style/Circle~Options=} opt_options Options.
|
||||
* @extends {module:ol/style/RegularShape}
|
||||
* @api
|
||||
*/
|
||||
class CircleStyle {
|
||||
class CircleStyle extends RegularShape {
|
||||
/**
|
||||
* @classdesc
|
||||
* Set circle style for vector features.
|
||||
*
|
||||
* @constructor
|
||||
* @param {module:ol/style/Circle~Options=} opt_options Options.
|
||||
* @extends {module:ol/style/RegularShape}
|
||||
* @api
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
|
||||
const options = opt_options || {};
|
||||
|
||||
RegularShape.call(this, {
|
||||
super({
|
||||
points: Infinity,
|
||||
fill: options.fill,
|
||||
radius: options.radius,
|
||||
@@ -76,7 +76,5 @@ class CircleStyle {
|
||||
}
|
||||
}
|
||||
|
||||
inherits(CircleStyle, RegularShape);
|
||||
|
||||
|
||||
export default CircleStyle;
|
||||
|
||||
+11
-13
@@ -52,16 +52,16 @@ import ImageStyle from '../style/Image.js';
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Set icon style for vector features.
|
||||
*
|
||||
* @constructor
|
||||
* @param {module:ol/style/Icon~Options=} opt_options Options.
|
||||
* @extends {module:ol/style/Image}
|
||||
* @api
|
||||
*/
|
||||
class Icon {
|
||||
class Icon extends ImageStyle {
|
||||
/**
|
||||
* @classdesc
|
||||
* Set icon style for vector features.
|
||||
*
|
||||
* @constructor
|
||||
* @param {module:ol/style/Icon~Options=} opt_options Options.
|
||||
* @extends {module:ol/style/Image}
|
||||
* @api
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
|
||||
const options = opt_options || {};
|
||||
@@ -203,7 +203,7 @@ class Icon {
|
||||
const snapToPixel = options.snapToPixel !== undefined ?
|
||||
options.snapToPixel : true;
|
||||
|
||||
ImageStyle.call(this, {
|
||||
super({
|
||||
opacity: opacity,
|
||||
rotation: rotation,
|
||||
scale: scale,
|
||||
@@ -418,7 +418,5 @@ class Icon {
|
||||
}
|
||||
}
|
||||
|
||||
inherits(Icon, ImageStyle);
|
||||
|
||||
|
||||
export default Icon;
|
||||
|
||||
+12
-14
@@ -9,20 +9,20 @@ import EventType from '../events/EventType.js';
|
||||
import ImageState from '../ImageState.js';
|
||||
import {shared as iconImageCache} from '../style/IconImageCache.js';
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {HTMLImageElement|HTMLCanvasElement} image Image.
|
||||
* @param {string|undefined} src Src.
|
||||
* @param {module:ol/size~Size} size Size.
|
||||
* @param {?string} crossOrigin Cross origin.
|
||||
* @param {module:ol/ImageState} imageState Image state.
|
||||
* @param {module:ol/color~Color} color Color.
|
||||
* @extends {module:ol/events/EventTarget}
|
||||
*/
|
||||
class IconImage {
|
||||
class IconImage extends EventTarget {
|
||||
/**
|
||||
* @constructor
|
||||
* @param {HTMLImageElement|HTMLCanvasElement} image Image.
|
||||
* @param {string|undefined} src Src.
|
||||
* @param {module:ol/size~Size} size Size.
|
||||
* @param {?string} crossOrigin Cross origin.
|
||||
* @param {module:ol/ImageState} imageState Image state.
|
||||
* @param {module:ol/color~Color} color Color.
|
||||
* @extends {module:ol/events/EventTarget}
|
||||
*/
|
||||
constructor(image, src, size, crossOrigin, imageState, color) {
|
||||
|
||||
EventTarget.call(this);
|
||||
super();
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -241,8 +241,6 @@ class IconImage {
|
||||
}
|
||||
}
|
||||
|
||||
inherits(IconImage, EventTarget);
|
||||
|
||||
|
||||
/**
|
||||
* @param {HTMLImageElement|HTMLCanvasElement} image Image.
|
||||
|
||||
@@ -46,18 +46,18 @@ import ImageStyle from '../style/Image.js';
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Set regular shape style for vector features. The resulting shape will be
|
||||
* a regular polygon when `radius` is provided, or a star when `radius1` and
|
||||
* `radius2` are provided.
|
||||
*
|
||||
* @constructor
|
||||
* @param {module:ol/style/RegularShape~Options} options Options.
|
||||
* @extends {module:ol/style/Image}
|
||||
* @api
|
||||
*/
|
||||
class RegularShape {
|
||||
class RegularShape extends ImageStyle {
|
||||
/**
|
||||
* @classdesc
|
||||
* Set regular shape style for vector features. The resulting shape will be
|
||||
* a regular polygon when `radius` is provided, or a star when `radius1` and
|
||||
* `radius2` are provided.
|
||||
*
|
||||
* @constructor
|
||||
* @param {module:ol/style/RegularShape~Options} options Options.
|
||||
* @extends {module:ol/style/Image}
|
||||
* @api
|
||||
*/
|
||||
constructor(options) {
|
||||
/**
|
||||
* @private
|
||||
@@ -164,7 +164,7 @@ class RegularShape {
|
||||
const rotateWithView = options.rotateWithView !== undefined ?
|
||||
options.rotateWithView : false;
|
||||
|
||||
ImageStyle.call(this, {
|
||||
super({
|
||||
opacity: 1,
|
||||
rotateWithView: rotateWithView,
|
||||
rotation: options.rotation !== undefined ? options.rotation : 0,
|
||||
@@ -591,7 +591,5 @@ class RegularShape {
|
||||
}
|
||||
}
|
||||
|
||||
inherits(RegularShape, ImageStyle);
|
||||
|
||||
|
||||
export default RegularShape;
|
||||
|
||||
Reference in New Issue
Block a user