Slope Analysis
DMap3D.analysis.slopAnalyse is used to analyze the slope of terrain surfaces, visually displaying terrain slope distribution through color gradients.
Import
import DMap3D from 'dmap3d'
import * as Cesium from 'cesium'
Basic Usage
const viewer = new Cesium.Viewer('cesiumContainer')
// Create slope analysis tool
const slopAnalyse = new DMap3D.analysis.slopAnalyse(viewer)
// Show slope analysis
slopAnalyse.show()
Constructor
new DMap3D.analysis.slopAnalyse(viewer, options?)
Parameters:
viewer- Cesium.Viewer instanceoptions?- Optional configuration
Options:
interface SlopOptions {
color?: string // Color configuration
isActive?: boolean // Whether to activate by default
}
Methods
show()
Show the slope analysis effect.
slopAnalyse.show()
hide()
Hide the slope analysis effect.
slopAnalyse.hide()
destroy()
Destroy the tool and release resources.
slopAnalyse.destroy()
Complete Example
const viewer = new Cesium.Viewer('cesiumContainer')
// Create slope analysis tool
const slopAnalyse = new DMap3D.analysis.slopAnalyse(viewer)
// Show slope analysis
slopAnalyse.show()
// Hide
slopAnalyse.hide()
// Destroy
slopAnalyse.destroy()