Manual class transform

This commit is contained in:
Tim Schaub
2018-07-16 17:09:50 -06:00
parent 7b4a73f3b9
commit f78d0d4cfa
96 changed files with 8112 additions and 7964 deletions
+43 -41
View File
@@ -29,52 +29,54 @@ import RegularShape from '../style/RegularShape.js';
* @extends {module:ol/style/RegularShape}
* @api
*/
const CircleStyle = function(opt_options) {
class CircleStyle {
constructor(opt_options) {
const options = opt_options || {};
const options = opt_options || {};
RegularShape.call(this, {
points: Infinity,
fill: options.fill,
radius: options.radius,
snapToPixel: options.snapToPixel,
stroke: options.stroke,
atlasManager: options.atlasManager
});
RegularShape.call(this, {
points: Infinity,
fill: options.fill,
radius: options.radius,
snapToPixel: options.snapToPixel,
stroke: options.stroke,
atlasManager: options.atlasManager
});
};
}
/**
* Clones the style. If an atlasmanager was provided to the original style it will be used in the cloned style, too.
* @return {module:ol/style/Circle} The cloned style.
* @override
* @api
*/
clone() {
const style = new CircleStyle({
fill: this.getFill() ? this.getFill().clone() : undefined,
stroke: this.getStroke() ? this.getStroke().clone() : undefined,
radius: this.getRadius(),
snapToPixel: this.getSnapToPixel(),
atlasManager: this.atlasManager_
});
style.setOpacity(this.getOpacity());
style.setScale(this.getScale());
return style;
}
/**
* Set the circle radius.
*
* @param {number} radius Circle radius.
* @api
*/
setRadius(radius) {
this.radius_ = radius;
this.render_(this.atlasManager_);
}
}
inherits(CircleStyle, RegularShape);
/**
* Clones the style. If an atlasmanager was provided to the original style it will be used in the cloned style, too.
* @return {module:ol/style/Circle} The cloned style.
* @override
* @api
*/
CircleStyle.prototype.clone = function() {
const style = new CircleStyle({
fill: this.getFill() ? this.getFill().clone() : undefined,
stroke: this.getStroke() ? this.getStroke().clone() : undefined,
radius: this.getRadius(),
snapToPixel: this.getSnapToPixel(),
atlasManager: this.atlasManager_
});
style.setOpacity(this.getOpacity());
style.setScale(this.getScale());
return style;
};
/**
* Set the circle radius.
*
* @param {number} radius Circle radius.
* @api
*/
CircleStyle.prototype.setRadius = function(radius) {
this.radius_ = radius;
this.render_(this.atlasManager_);
};
export default CircleStyle;