Merge branch 'pattern' into 'master'

Pattern

新增pattern数据映射

See merge request !35
This commit is contained in:
thinkinggis 2019-07-08 16:53:45 +08:00
commit c3c93e00d4
7 changed files with 30 additions and 6 deletions

View File

@ -81,6 +81,7 @@ scene.on('loaded', () => {
} }
}) })
.shape('fill') .shape('fill')
.pattern('id1')
.active(true) .active(true)
.style({ .style({
opacity: 1 opacity: 1

View File

@ -1,6 +1,6 @@
{ {
"name": "@antv/l7", "name": "@antv/l7",
"version": "1.2.0-beta.0", "version": "1.2.0-beta.1",
"description": "Large-scale WebGL-powered Geospatial Data Visualization", "description": "Large-scale WebGL-powered Geospatial Data Visualization",
"main": "build/l7.js", "main": "build/l7.js",
"browser": "build/l7.js", "browser": "build/l7.js",

View File

@ -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) {

View File

@ -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;

16
src/attr/pattern.js Normal file
View File

@ -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;

View File

@ -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 是否允许激活开关

View File

@ -5,7 +5,7 @@
// const Global = {}; // const Global = {};
const FONT_FAMILY = '"-apple-system", BlinkMacSystemFont, "Segoe UI", Roboto,"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",SimSun, "sans-serif"'; const FONT_FAMILY = '"-apple-system", BlinkMacSystemFont, "Segoe UI", Roboto,"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",SimSun, "sans-serif"';
const Global = { const Global = {
version: '1.2.0-beta.0', version: '1.2.0-beta.1',
scene: { scene: {
mapType: 'AMAP', mapType: 'AMAP',
zoom: 5, zoom: 5,
@ -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' ],