mirror of https://gitee.com/antv-l7/antv-l7
feat(attr): add pattern
This commit is contained in:
parent
83f7cb545c
commit
4f55374345
|
@ -81,6 +81,7 @@ scene.on('loaded', () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.shape('fill')
|
.shape('fill')
|
||||||
|
.pattern('id1')
|
||||||
.active(true)
|
.active(true)
|
||||||
.style({
|
.style({
|
||||||
opacity: 1
|
opacity: 1
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/*
|
/*
|
||||||
* @Author: ThinkGIS
|
* @Author: ThinkGIS
|
||||||
* @Date: 2018-06-14 20:13:18
|
* @Date: 2018-06-14 20:13:18
|
||||||
* @Last Modified by: ThinkGIS
|
* @Last Modified by: mikey.zhaopeng
|
||||||
* @Last Modified time: 2018-07-15 17:26:40
|
* @Last Modified time: 2019-07-08 15:46:28
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Base from './base';
|
import Base from './base';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 视觉通道 symbol
|
* 视觉通道 filter
|
||||||
* @class Attr.symbol
|
* @class Attr.filter
|
||||||
*/
|
*/
|
||||||
class Filter extends Base {
|
class Filter extends Base {
|
||||||
constructor(cfg) {
|
constructor(cfg) {
|
||||||
|
|
|
@ -7,6 +7,7 @@ import Shape from './shape';
|
||||||
import Position from './position';
|
import Position from './position';
|
||||||
import Symbol from './symbol';
|
import Symbol from './symbol';
|
||||||
import Filter from './filter';
|
import Filter from './filter';
|
||||||
|
import Pattern from './pattern';
|
||||||
|
|
||||||
Base.Color = Color;
|
Base.Color = Color;
|
||||||
Base.Size = Size;
|
Base.Size = Size;
|
||||||
|
@ -15,5 +16,6 @@ Base.Shape = Shape;
|
||||||
Base.Position = Position;
|
Base.Position = Position;
|
||||||
Base.Symbol = Symbol;
|
Base.Symbol = Symbol;
|
||||||
Base.Filter = Filter;
|
Base.Filter = Filter;
|
||||||
|
Base.Pattern = Pattern;
|
||||||
|
|
||||||
export default Base;
|
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);
|
this._createAttrOption('shape', field, values, Global.shape);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
pattern(field, values) {
|
||||||
|
this._createAttrOption('pattern', field, values, Global.pattern);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 是否允许使用默认的图形激活交互
|
* 是否允许使用默认的图形激活交互
|
||||||
* @param {Boolean} enable 是否允许激活开关
|
* @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)' ],
|
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,
|
size: 10000,
|
||||||
shape: 'circle',
|
shape: 'circle',
|
||||||
|
pattern: '',
|
||||||
snapArray: [ 0, 1, 2, 4, 5, 10 ],
|
snapArray: [ 0, 1, 2, 4, 5, 10 ],
|
||||||
pointShape: {
|
pointShape: {
|
||||||
'2d': [ 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica' ],
|
'2d': [ 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica' ],
|
||||||
|
|
Loading…
Reference in New Issue