量测分析
框架支持各类空间量测
量测支持
INFO
距离量测:空间-line,投影-project,地表-onground,椭球-elliptic
面积量测:投影-project,地表-onground,椭球-elliptic
其他量测:高差量测、三角量测、方位角量测和体积量测
代码实例
初始场景
ts
let map: any
LarkExplorer.ready({
baseUrl: './dist/resources/',
}).then(initMap)
function initMap() {
// 默认谷歌影像地图
const baseImagery = LarkExplorer.BaseLayer.DefaultTdtImg
// 默认全球地形
const baseTerrain = LarkExplorer.BaseLayer.DefaultTerrain
map = new LarkExplorer.Map('map', baseImagery, baseTerrain)
initView()
}
function initView() {
const status = {
position: {
x: -947707.6526854301,
y: 5525655.629629169,
z: 3043025.882299652,
},
hpr: {
heading: 3.862207334800405,
pitch: -0.3624409974692644,
roll: 0.0001087727106403591,
},
}
map.Navigation.flyToPos(status, 3)
}
距离量测
ts
/**
* 距离测量
* @param type line:空间,project:投影,onground:地表,elliptic:椭球
*/
const distance = (type: string) => {
map.SpecialAnalysis.Measurement.distance(type, (res: any) => {
console.log('距离量测结果:', res)
})
}
面积量测
ts
/**
* 面积测量
* @param type project:投影,onground:地表,elliptic:椭球
*/
const area = (type: string) => {
map.SpecialAnalysis.Measurement.area(type, (res: any) => {
console.log('面积量测结果:', res)
})
}
其他量测
ts
const height = () => {
map.SpecialAnalysis.Measurement.height((res: any) => {
console.log('高差量测结果:', res)
})
}
const angle = () => {
map.SpecialAnalysis.Measurement.azimuth((res: any) => {
console.log('方位角量测结果:', res)
})
}
const triangle = () => {
map.SpecialAnalysis.Measurement.triangle((res: any) => {
console.log('三角量测结果:', res)
})
}
const volume = () => {
map.SpecialAnalysis.Measurement.volume((res: any) => {
console.log('体积量测结果:', res)
})
}
移除量测结果
ts
const removeAll = () => {
map.SpecialAnalysis.Measurement.removeAll()
}
运行效果
更多示例