@mapgpu/core
Core types, MapView, event system, projections, and renderers.
npm install @mapgpu/core Exports
MapView Unified map view with 2D/3D mode switching. Creates a WebGPU canvas, manages layers, handles user interaction, and provides coordinate conversion. This is the main entry point for the library.
GameMap Layer container that manages add, remove, reorder, and findById operations. Accessed via MapView.map.
SimpleRenderer Applies the same symbol to every feature. Use when all features should look identical.
UniqueValueRenderer Assigns symbols based on a feature attribute value. Use for categorical data (e.g. country, type, status).
ClassBreaksRenderer Assigns symbols based on numeric ranges. Use for quantitative data (e.g. population, elevation, speed).
CallbackRenderer Per-feature dynamic symbol via a callback function. Maximum flexibility — use when other renderers are insufficient.
PointSymbol Symbol definition for point features. Supports simple circle markers, icon images, and SDF icons. Includes optional glow halo and background circle effects.
LineSymbol Symbol definition for line/polyline features. Supports solid, dash, dot, and dash-dot styles with optional animated dashes and glow effects.
PolygonSymbol Symbol definition for polygon features. Supports fill color, outline, and optional glow effect on the outline.
GlobeProjection Dual projection that blends Mercator (flat) and Vertical Perspective (globe) based on zoom level. Transition happens at zoom 5-6 with a smooth globeness factor.
VectorBufferCache GPU buffer cache for vector features. Builds GPU buffers from Feature[] + Renderer, caches by layer ID and symbol key. Invalidates on data or renderer change.