Skip to content

SpriteGeometry

Introduction

SpriteGeometry is a universal particle layer provided by L7, which can be used to draw various particle effects.

demo

Set up a normal particle layer.

import { Scene, GeometryLayer } from '@antv/l7';

let layer = new GeometryLayer()
  .shape('sprite')
  .size(10)
  .style({
    opacity: 0.3,
    center: [120, 30],
    spriteCount: 120,
    spriteRadius: 10,
    spriteTop: 300,
    spriteUpdate: 10,
    spriteScale: 0.6,
  });
案例

Online case

source

🌟 SpriteGeometry does not need to set the source, we give its position information through center in style.

style

SpriteGeometry mainly sets position, size and other properties through the style method.

center: [lng: number, lat: number]

Sets the position of the SpriteGeometry. Positioning is the center of the SpriteGeometry.

mapTexture: string

Set the sprite’s texture map.

spriteRadius: number

The radius of action of particles, default is 10.
🌟 Individual particles will be randomly distributed within the radius of the layer position.

spriteAnimate: string

The particle’s movement defaults to ‘down’, which means downward movement. Optional values ​​are ‘down’/‘up’.

spriteCount: number

The number of particles generated by the layer, default is 100.

spriteTop: number

The height range of particle movement, the default is 300.

spriteUpdate: number

The step size of particle motion refresh, expressed as motion speed, default is 10.

spriteScale: number

Particle size scaling, default is 1.

© Copyright 2026 Ant Group Co., Ltd..备案号:京ICP备15032932号-38
Site search
Documentation and examplesType to start searching

Search documentation, APIs, and examples

↑↓Select↵OpenEscClose