function (brushOptionList) {
        if (__DEV__) {
            zrUtil.assert(this._mounted);
        }

        brushOptionList = zrUtil.map(brushOptionList, function (brushOption) {
            return zrUtil.merge(zrUtil.clone(DEFAULT_BRUSH_OPT), brushOption, true);
        });

        var tmpIdPrefix = '\0-brush-index-';
        var oldCovers = this._covers;
        var newCovers = this._covers = [];
        var controller = this;
        var creatingCover = this._creatingCover;

        (new DataDiffer(oldCovers, brushOptionList, oldGetKey, getKey))
            .add(addOrUpdate)
            .update(addOrUpdate)
            .remove(remove)
            .execute();

        return this;

        function getKey(brushOption, index) {
            return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index)
                + '-' + brushOption.brushType;
        }

        function oldGetKey(cover, index) {
            return getKey(cover.__brushOption, index);
        }

        function addOrUpdate(newIndex, oldIndex) {
            var newBrushOption = brushOptionList[newIndex];
            // Consider setOption in event listener of brushSelect,
            // where updating cover when creating should be forbiden.
            if (oldIndex != null && oldCovers[oldIndex] === creatingCover) {
                newCovers[newIndex] = oldCovers[oldIndex];
            }
            else {
                var cover = newCovers[newIndex] = oldIndex != null
                    ? (
                        oldCovers[oldIndex].__brushOption = newBrushOption,
                        oldCovers[oldIndex]
                    )
                    : endCreating(controller, createCover(controller, newBrushOption));
                updateCoverAfterCreation(controller, cover);
            }
        }

        function remove(oldIndex) {
            if (oldCovers[oldIndex] !== creatingCover) {
                controller.group.remove(oldCovers[oldIndex]);
            }
        }
    }
function (brushOptionList) {
        if (__DEV__) {
            zrUtil.assert(this._mounted);
        }

        brushOptionList = zrUtil.map(brushOptionList, function (brushOption) {
            return zrUtil.merge(zrUtil.clone(DEFAULT_BRUSH_OPT), brushOption, true);
        });

        var tmpIdPrefix = '\0-brush-index-';
        var oldCovers = this._covers;
        var newCovers = this._covers = [];
        var controller = this;
        var creatingCover = this._creatingCover;

        (new DataDiffer(oldCovers, brushOptionList, oldGetKey, getKey))
            .add(addOrUpdate)
            .update(addOrUpdate)
            .remove(remove)
            .execute();

        return this;

        function getKey(brushOption, index) {
            return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index)
                + '-' + brushOption.brushType;
        }

        function oldGetKey(cover, index) {
            return getKey(cover.__brushOption, index);
        }

        function addOrUpdate(newIndex, oldIndex) {
            var newBrushOption = brushOptionList[newIndex];
            // Consider setOption in event listener of brushSelect,
            // where updating cover when creating should be forbiden.
            if (oldIndex != null && oldCovers[oldIndex] === creatingCover) {
                newCovers[newIndex] = oldCovers[oldIndex];
            }
            else {
                var cover = newCovers[newIndex] = oldIndex != null
                    ? (
                        oldCovers[oldIndex].__brushOption = newBrushOption,
                        oldCovers[oldIndex]
                    )
                    : endCreating(controller, createCover(controller, newBrushOption));
                updateCoverAfterCreation(controller, cover);
            }
        }

        function remove(oldIndex) {
            if (oldCovers[oldIndex] !== creatingCover) {
                controller.group.remove(oldCovers[oldIndex]);
            }
        }
    }
function ( brushOptionList ) { if ( __DEV__ ) { zrUtil . assert ( this . _mounted ) ; } brushOptionList = zrUtil . map ( brushOptionList , function ( brushOption ) { return zrUtil . merge ( zrUtil . clone ( DEFAULT_BRUSH_OPT ) , brushOption , true ) ; } ) ; var tmpIdPrefix = '\0-brush-index-' ; var oldCovers = this . _covers ; var newCovers = this . _covers = [ ] ; var controller = this ; var creatingCover = this . _creatingCover ; ( new DataDiffer ( oldCovers , brushOptionList , oldGetKey , getKey ) ) . add ( addOrUpdate ) . update ( addOrUpdate ) . remove ( remove ) . execute ( ) ; return this ; function getKey ( brushOption , index ) { return ( brushOption . id != null ? brushOption . id : tmpIdPrefix + index ) + '-' + brushOption . brushType ; } function oldGetKey ( cover , index ) { return getKey ( cover . __brushOption , index ) ; } function addOrUpdate ( newIndex , oldIndex ) { var newBrushOption = brushOptionList [ newIndex ] ; // Consider setOption in event listener of brushSelect, // where updating cover when creating should be forbiden. if ( oldIndex != null && oldCovers [ oldIndex ] === creatingCover ) { newCovers [ newIndex ] = oldCovers [ oldIndex ] ; } else { var cover = newCovers [ newIndex ] = oldIndex != null ? ( oldCovers [ oldIndex ] . __brushOption = newBrushOption , oldCovers [ oldIndex ] ) : endCreating ( controller , createCover ( controller , newBrushOption ) ) ; updateCoverAfterCreation ( controller , cover ) ; } } function remove ( oldIndex ) { if ( oldCovers [ oldIndex ] !== creatingCover ) { controller . group . remove ( oldCovers [ oldIndex ] ) ; } } }
Update covers.
@param {Array.<Object>} brushOptionList Like:
[
{id: 'xx', brushType: 'line', range: [23, 44], brushStyle, transformable},
{id: 'yy', brushType: 'rect', range: [[23, 44], [23, 54]]},
...
]
`brushType` is required in each cover info. (can not be 'auto')
`id` is not mandatory.
`brushStyle`, `transformable` is not mandatory, use DEFAULT_BRUSH_OPT by default.
If brushOptionList is null/undefined, all covers removed.
Update covers .
Set the brush option list