API Reference
DMap3D SDK provides a rich set of API interfaces covering measurement, analysis, drawing, and other functional modules.
Main Modules
Measurement Tools (DMap3D.measurement)
Various measurement capabilities:
- Distance Measurement - Measure distance between two or more points
- Area Measurement - Measure the area of a polygon region
- Height Measurement - Measure height information of a point
- Angle Measurement - Measure the angle formed by three points
- Slope Measurement - Measure terrain slope
- Azimuth Measurement - Measure azimuth angle
Analysis Tools (DMap3D.analysis)
Various spatial analysis capabilities:
- Viewshed Analysis - Analyze the visible range from a point
- Aspect Analysis - Analyze terrain aspect direction
- Contour Analysis - Generate contour lines
- Cut and Fill Analysis - Calculate cut and fill volumes
Drawing Tools (DMap3D.drawing)
Various drawing capabilities:
- Point Drawing - Draw points on the map
- Line Drawing - Draw lines on the map
- Polygon Drawing - Draw polygons on the map
Usage Pattern
All tools follow a unified usage pattern:
import DMap3D from 'dmap3d'
import * as Cesium from 'cesium'
// 1. Create Viewer
const viewer = new Cesium.Viewer('cesiumContainer')
// 2. Create tool instance
const tool = new DMap3D.measurement.area(viewer, options)
// 3. Listen for events
tool.on('measureComplete', (result) => {
console.log('Measurement result:', result)
})
// 4. Start the tool
tool.start()
// 5. Destroy the tool
tool.destroy()
Type Definitions
DMap3D SDK is written entirely in TypeScript, and all APIs have complete type definitions:
interface ITool {
start(): void
stop(): void
destroy(): void
on(event: string, callback: Function): void
off(event: string, callback: Function): void
}
Browser Support
- Chrome >= 90
- Firefox >= 88
- Safari >= 14
- Edge >= 90
Next Steps
- Browse Measurement Tools API
- View Example Code