/**
* BeNomad BeMap JavaScript API - CircleStyle
*/
/**
* @classdesc
* Base class for CircleStyle.
* @public
* @constructor
* @param {Object} options See below the available values.
* @param {bemap.Color} options.fillColor Set the fill color of the circle with a bemap.Color.
* @param {bemap.Color} options.borderColor Set the border color of the circle with a bemap.Color.
* @param {int} options.borderWidth Set the border width of the circle in pixels.
* @param {bemap.CircleStyle.TYPE} options.borderType define the border type of the circle.
*/
bemap.CircleStyle = function(options) {
var opts = options || {};
/**
* @type {Object}
* @protected
*/
this.native = null;
/**
* Fill color.
* @type {Object}
* @protected
*/
this.fillColor = opts.fillColor ? opts.fillColor : new bemap.Color();
/**
* Border color.
* @type {Object}
* @protected
*/
this.borderColor = opts.borderColor ? opts.borderColor : new bemap.Color();
/**
* Border width.
* @type {int}
* @protected
*/
this.borderWidth = opts.borderWidth ? opts.borderWidth : 3;
/**
* Border type.
* @type {String}
* @protected
*/
this.borderType = opts.borderType ? opts.borderType : bemap.CircleStyle.TYPE.PLANE;
};
/**
* List of available type for the circle style.
* @public
* @enum bemap.CircleStyle.TYPE
*/
bemap.CircleStyle.TYPE = {
DASH: "dash",
PLANE: "plane",
DOT: "dot",
DOT_DASH: "dot dash"
};
/**
* Return the bemap.Color which set the fill color of the circle.
* @return {bemap.Color} Return the Bemap.Color which set the fill color of the circle.
*/
bemap.CircleStyle.prototype.getFillColor = function() {
return this.fillColor;
};
/**
* Set the bemap.Color which set the fill color of the circle.
* @param {bemap.Color} fillColor the new bemap.Color to set the fill color.
* @return {bemap.CircleStyle} Return this.
*/
bemap.CircleStyle.prototype.setFillColor = function(fillColor) {
this.fillColor = fillColor;
return this;
};
/**
* Get the border type of the circle style.
* @return {String} the border type of the circle.
*/
bemap.CircleStyle.prototype.getBorderType = function() {
return this.borderType;
};
/**
* Set the border type of the circle.
* @param {String} type the new border type to set.
* @return {bemap.CircleStyle} return this.
*/
bemap.CircleStyle.prototype.setBorderType = function(borderType) {
this.borderType = borderType;
return this;
};
/**
* Return the bemap.Color which set the border color of the circle.
* @return {bemap.Color} Return the Bemap.Color which set the border color of the circle.
*/
bemap.CircleStyle.prototype.getBorderColor = function() {
return this.borderColor;
};
/**
* Set the bemap.Color which set the border color of the circle.
* @param {bemap.Color} Color the new bemap.Color to set the border color.
* @return {bemap.CircleStyle} Return this.
*/
bemap.CircleStyle.prototype.setBorderColor = function(borderColor) {
this.borderColor = borderColor;
return this;
};
/**
* Return the border width of the circle.
* @return {int} Return the border width of the circle.
*/
bemap.CircleStyle.prototype.getBorderWidth = function() {
return this.borderWidth;
};
/**
* Set the border width of the circle.
* @param {double} width the new border width of the circle to set.
* @return {bemap.CircleStyle} Return this.
*/
bemap.CircleStyle.prototype.setBorderWidth = function(borderWidth) {
this.borderWidth = borderWidth;
return this;
};