UNPKG

s2maps-gpu

Version:

S2 Maps GPU - An open source, high-performance, and GPU-accelerated map engine for rendering large-scale, interactive maps.

100 lines (99 loc) 2.49 kB
import type { ColorArray } from 'style/color/index.js'; import type { PathData } from '../util/index.js'; import type { Point } from 'gis-tools/index.js'; import type { Alignment, Anchor } from 'style/style.spec.js'; /** a bounding box like structure */ export interface SquareNode { id: number; minX: number; minY: number; maxX: number; maxY: number; } /** a bounding circle like structure */ export interface RoundNode { x: number; y: number; r: number; } /** collection of round nodes */ export interface RoundNodes { id: number; nodes: RoundNode[]; } /** a node is a collection of square or round nodes */ export type Node = SquareNode | RoundNodes; /** a glyph descriptor. */ export type GlyphData = [family: string, char: string]; /** * Glyph Base properties found in all glyph types */ export interface GlyphBase { id: number; idRGB: ColorArray; layerIndex: number; gl2Code: number[]; code: number[]; overdraw: boolean; family: string[]; field: string; fieldCodes: string[]; spacing: number; offset: Point; padding: Point; kerning: number; lineHeight: number; type: 'text' | 'icon'; wordWrap: number; align: Alignment; anchor: Anchor; size: number; quads: number[]; color: number[]; missing: boolean; } /** * Glyph Point is a glyph rendering that has a singular anchor point to render from */ export interface GlyphPoint extends GlyphBase, SquareNode { glyphType: 'point'; s: number; t: number; filter: [ s: number, t: number, xPos: number, yPos: number, offsetX: number, offsetY: number, paddingX: number, paddingY: number, maxWidth: number, maxHeight: number ]; } /** Glyph's renderered along a path have their own filter data */ export type PathFilter = [ s: number, t: number, offsetX: number, offsetY: number, xPos: number, yPos: number, path1X: number, path1Y: number, path2X: number, path2Y: number, path3X: number, path3Y: number, padding: number ]; /** Glyph Path data is a collection of glyphs that follow along a vector line */ export interface GlyphPath extends GlyphBase, RoundNodes { glyphType: 'path'; extent: number; pathData: PathData; filters: PathFilter[]; } /** A Glpyh object is either a GlyphPoint or GlyphPath */ export type GlyphObject = GlyphPoint | GlyphPath;