diff --git a/packages/core/src/services/layer/IStyleAttributeService.ts b/packages/core/src/services/layer/IStyleAttributeService.ts index a33101d141..ad7abab1b4 100644 --- a/packages/core/src/services/layer/IStyleAttributeService.ts +++ b/packages/core/src/services/layer/IStyleAttributeService.ts @@ -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 { diff --git a/packages/layers/src/Geometry/shaders/sprite_frag.glsl b/packages/layers/src/Geometry/shaders/sprite_frag.glsl index 42f5eb751c..012ef3c87c 100644 --- a/packages/layers/src/Geometry/shaders/sprite_frag.glsl +++ b/packages/layers/src/Geometry/shaders/sprite_frag.glsl @@ -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); } diff --git a/packages/layers/src/Geometry/shaders/sprite_vert.glsl b/packages/layers/src/Geometry/shaders/sprite_vert.glsl index bb25031536..5caf500f3c 100644 --- a/packages/layers/src/Geometry/shaders/sprite_vert.glsl +++ b/packages/layers/src/Geometry/shaders/sprite_vert.glsl @@ -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); } diff --git a/packages/layers/src/plugins/FeatureScalePlugin.ts b/packages/layers/src/plugins/FeatureScalePlugin.ts index 1e91e3ddc8..0b03128ec8 100644 --- a/packages/layers/src/plugins/FeatureScalePlugin.ts +++ b/packages/layers/src/plugins/FeatureScalePlugin.ts @@ -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; diff --git a/stories/Object/components/sprite.tsx b/stories/Object/components/sprite.tsx index db6af567aa..37ee983f7e 100644 --- a/stories/Object/components/sprite.tsx +++ b/stories/Object/components/sprite.tsx @@ -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', () => {