mirror of https://gitee.com/antv-l7/antv-l7
feat(attr): add pattern
This commit is contained in:
parent
c5dd7a402a
commit
1eef58a29a
|
@ -81,6 +81,7 @@ scene.on('loaded', () => {
|
|||
}
|
||||
})
|
||||
.shape('fill')
|
||||
.pattern('id1')
|
||||
.active(true)
|
||||
.style({
|
||||
opacity: 1
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
/*
|
||||
* @Author: ThinkGIS
|
||||
* @Date: 2018-06-14 20:13:18
|
||||
* @Last Modified by: ThinkGIS
|
||||
* @Last Modified time: 2018-07-15 17:26:40
|
||||
* @Last Modified by: mikey.zhaopeng
|
||||
* @Last Modified time: 2019-07-08 15:46:28
|
||||
*/
|
||||
|
||||
import Base from './base';
|
||||
|
||||
/**
|
||||
* 视觉通道 symbol
|
||||
* @class Attr.symbol
|
||||
* 视觉通道 filter
|
||||
* @class Attr.filter
|
||||
*/
|
||||
class Filter extends Base {
|
||||
constructor(cfg) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import Shape from './shape';
|
|||
import Position from './position';
|
||||
import Symbol from './symbol';
|
||||
import Filter from './filter';
|
||||
import Pattern from './pattern';
|
||||
|
||||
Base.Color = Color;
|
||||
Base.Size = Size;
|
||||
|
@ -15,5 +16,6 @@ Base.Shape = Shape;
|
|||
Base.Position = Position;
|
||||
Base.Symbol = Symbol;
|
||||
Base.Filter = Filter;
|
||||
Base.Pattern = Pattern;
|
||||
|
||||
export default Base;
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
import Base from './base';
|
||||
|
||||
/**
|
||||
* 视觉通道 pattern
|
||||
* @class Attr.pattern
|
||||
*/
|
||||
class Pattern extends Base {
|
||||
constructor(cfg) {
|
||||
super(cfg);
|
||||
this.names = [ 'pattern' ];
|
||||
this.type = 'pattern';
|
||||
this.gradient = null;
|
||||
}
|
||||
}
|
||||
export default Pattern;
|
|
@ -176,6 +176,10 @@ export default class Layer extends Base {
|
|||
this._createAttrOption('shape', field, values, Global.shape);
|
||||
return this;
|
||||
}
|
||||
pattern(field, values) {
|
||||
this._createAttrOption('pattern', field, values, Global.pattern);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* 是否允许使用默认的图形激活交互
|
||||
* @param {Boolean} enable 是否允许激活开关
|
||||
|
|
|
@ -21,6 +21,7 @@ const Global = {
|
|||
colors: [ 'rgb(103,0,31)', 'rgb(178,24,43)', 'rgb(214,96,77)', 'rgb(244,165,130)', 'rgb(253,219,199)', 'rgb(247,247,247)', 'rgb(209,229,240)', 'rgb(146,197,222)', 'rgb(67,147,195)', 'rgb(33,102,172)', 'rgb(5,48,97)' ],
|
||||
size: 10000,
|
||||
shape: 'circle',
|
||||
pattern: '',
|
||||
snapArray: [ 0, 1, 2, 4, 5, 10 ],
|
||||
pointShape: {
|
||||
'2d': [ 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica' ],
|
||||
|
|
Loading…
Reference in New Issue