@composy/3d-map-core
v0.0.1
Published
3d地图
Readme
@composy/3d-map-core
Framework-agnostic 3D map engine for LDesign.
What It Provides
MapEnginelifecycle and camera APIs.MapRendererwrapper around MapLibre GL JS with fallback rendering.BuildingRendererfor Deck.gl 3D building extrusion.LayerManagerfor GeoJSON, heatmap, scatterplot, arc, and route layers.DataManager,OverpassClient, andCacheManagerfor data loading.InteractionManager,Picker, andInfoWindowwith safe DOM rendering.AnimationManager,CameraAnimation, andDataTransition.- Token-based themes:
darkTheme,lightTheme,satelliteTheme,cyberpunkTheme.
Usage
import { createMapEngine } from '@composy/3d-map-core'
const engine = await createMapEngine({
container: '#map',
center: [116.397428, 39.90923],
zoom: 14,
pitch: 45,
buildings: {
enabled: true,
style: {
color: 'var(--ld-primary-500)',
edgeColor: 'var(--ld-primary-700)',
opacity: 0.82,
},
},
})
engine.setTheme('dark')
engine.flyTo({ center: [121.473701, 31.230416], zoom: 15, pitch: 60 })Styling Rules
- Runtime-created elements use
ldesign-3d-map-*class names. - Colors use
packages/colorgenerated variables such as--ld-primary-500,--ld-bg-elevated, and--ld-text-primary. - Sizes use
packages/sizegenerated variables with the default--ld-*prefix. colorToRgba()resolves CSS variable colors before passing values to Deck.gl.
Build
pnpm --dir libraries/3d-map/packages/core run type-check
pnpm --dir libraries/3d-map/packages/core run buildOutputs:
dist/index.jsanddist/index.min.jses/**esm/**lib/**
