mirror of https://gitee.com/antv-l7/antv-l7
feat: sprite 优化,取消拾取,允许不设置 source (#1098)
* refactor: 修改 StyleAttributeField 的类型定义,允许图层在未设置 source 的时候设置 size * feat: sprite cancel picking capacity
This commit is contained in:
parent
936ac40d36
commit
e44ba06eae
|
@ -118,7 +118,7 @@ export interface IVertexAttributeDescriptor
|
|||
export type Position = number[];
|
||||
type Color = [number, number, number, number];
|
||||
type CallBack = (...args: any[]) => any;
|
||||
export type StyleAttributeField = string | string[] | number[];
|
||||
export type StyleAttributeField = string | string[] | number[] | number;
|
||||
export type StyleAttributeOption = string | number | boolean | any[] | CallBack;
|
||||
export type StyleAttrField = string | string[] | number | number[];
|
||||
export interface IAttributeScale {
|
||||
|
|
|
@ -6,7 +6,6 @@ uniform float u_opacity;
|
|||
varying vec3 v_Color;
|
||||
varying float v_d;
|
||||
|
||||
#pragma include "picking"
|
||||
void main() {
|
||||
|
||||
if(v_d < 0.0) {
|
||||
|
@ -19,6 +18,4 @@ void main() {
|
|||
} else {
|
||||
gl_FragColor = vec4(v_Color, u_opacity);
|
||||
}
|
||||
|
||||
gl_FragColor = filterColor(gl_FragColor);
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ varying vec3 v_Color;
|
|||
varying float v_d;
|
||||
|
||||
#pragma include "projection"
|
||||
#pragma include "picking"
|
||||
void main() {
|
||||
v_Color = a_Color;
|
||||
|
||||
|
@ -26,6 +25,4 @@ void main() {
|
|||
}
|
||||
|
||||
gl_PointSize = pow((u_Zoom - 1.0), 2.0) * u_Scale;
|
||||
|
||||
setPickingColor(a_PickingColor);
|
||||
}
|
||||
|
|
|
@ -183,7 +183,7 @@ export default class FeatureScalePlugin implements ILayerPlugin {
|
|||
* 'w' => ['w']
|
||||
*/
|
||||
private parseFields(
|
||||
field: string[] | string | number[],
|
||||
field: string[] | string | number[] | number,
|
||||
): string[] | number[] {
|
||||
if (Array.isArray(field)) {
|
||||
return field;
|
||||
|
|
|
@ -25,13 +25,13 @@ export default class Demo extends React.Component {
|
|||
this.scene = scene;
|
||||
|
||||
let layer = new GeometryLayer()
|
||||
.source([{ lng: 120, lat: 30 }], {
|
||||
parser: {
|
||||
type: 'json',
|
||||
x: 'lng',
|
||||
y: 'lat',
|
||||
},
|
||||
})
|
||||
// .source([{ lng: 120, lat: 30 }], {
|
||||
// parser: {
|
||||
// type: 'json',
|
||||
// x: 'lng',
|
||||
// y: 'lat',
|
||||
// },
|
||||
// })
|
||||
.shape('sprite')
|
||||
.size(10)
|
||||
.style({
|
||||
|
@ -50,6 +50,7 @@ export default class Demo extends React.Component {
|
|||
spriteScale: 0.6,
|
||||
// spriteUpdate: 20000
|
||||
})
|
||||
.active(true)
|
||||
.color('#f00');
|
||||
|
||||
scene.on('loaded', () => {
|
||||
|
|
Loading…
Reference in New Issue