Source: bemap-model/bemap-polygonStyle.js

/**
 * BeNomad BeMap JavaScript API - PolygonStyle
 */

/**
 * @classdesc
 * Base class for PolygonStyle.
 * @public
 * @constructor
 * @param {Object} options See below the available values.
 * @param {bemap.Color} options.fillColor Set the fill color of the polygon with a bemap.Color.
 * @param {bemap.Color} options.borderColor Set the border color of the polygon with a bemap.Color.
 * @param {int} options.borderWidth Set the border width of the polygon in pixels.
 * @param {bemap.PolygonStyle.TYPE} options.borderType define the border type of the polygon.
 */
bemap.PolygonStyle = 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.PolygonStyle.TYPE.PLANE;
};

/**
 * List of available type for the polygon style.
 * @public
 * @enum bemap.PolygonStyle.TYPE
 */
bemap.PolygonStyle.TYPE = {
    DASH: "dash",
    PLANE: "plane",
    DOT: "dot",
    DOT_DASH: "dot dash"
};

/**
 * Return the bemap.Color which set the fill color of the polygon.
 * @return {bemap.Color} Return the Bemap.Color which set the fill color of the polygon.
 */
bemap.PolygonStyle.prototype.getFillColor = function() {
    return this.fillColor;
};

/**
 * Set the bemap.Color which set the fill color of the polygon.
 * @param {bemap.Color} fillColor the new bemap.Color to set the fill color.
 * @return {bemap.PolygonStyle} Return this.
 */
bemap.PolygonStyle.prototype.setFillColor = function(fillColor) {
    this.fillColor = fillColor;
    return this;
};

/**
 * Get the border type of the polygon style.
 * @return {String} the border type of the polygon.
 */
bemap.PolygonStyle.prototype.getBorderType = function() {
    return this.borderType;
};

/**
 * Return the bemap.Color which set the border color of the polygon.
 * @return {bemap.Color} Return the Bemap.Color which set the border color of the polygon.
 */
bemap.PolygonStyle.prototype.getBorderColor = function() {
    return this.borderColor;
};

/**
 * Return the border width of the polygon.
 * @return {int} Return the border width of the polygon.
 */
bemap.PolygonStyle.prototype.getBorderWidth = function() {
    return this.borderWidth;
};

/**
 * Set the bemap.Color which set the border color of the polygon.
 * @param {bemap.Color} Color the new bemap.Color to set the border color.
 * @return {bemap.PolygonStyle} Return this.
 */
bemap.PolygonStyle.prototype.setBorderColor = function(borderColor) {
    this.borderColor = borderColor;
    return this;
};

/**
 * Set the border width of the polygon.
 * @param {double} width the new border width of the polygon to set.
 * @return {bemap.PolygonStyle} Return this.
 */
bemap.PolygonStyle.prototype.setBorderWidth = function(borderWidth) {
    this.borderWidth = borderWidth;
    return this;
};

/**
 * Set the border type of the polygon.
 * @param {String} type the new border type to set.
 * @return {bemap.PolygonStyle} return this.
 */
bemap.PolygonStyle.prototype.setBorderType = function(borderType) {
    this.borderType = borderType;
    return this;
};