handlerDis = new Cesium.MeasureHandler(viewer, Cesium.MeasureMode.Distance, 0);
var tooltip = createTooltip(document.body);
//注册测距功能事件
handlerDis.measureEvt.addEventListener(function (result) {
var dis = Number(result.distance);
var positions = result.positions;
// if (selOptV == 3 || selOptV == 4) {
// dis = Number(calcClampDistance(positions));
// }
var distance = dis > 1000 ? (dis / 1000).toFixed(2) + 'km' : dis.toFixed(2) + 'm';
handlerDis.disLabel.text = '距离:' + distance;
handlerDis.disLabel.outlineColor = {}
});
handlerDis.activeEvt.addEventListener(function (isActive) {
if (isActive == true) {
viewer.enableCursorStyle = false;
viewer._element.style.cursor = '';
$('body').removeClass('measureCur').addClass('measureCur');
}
else {
viewer.enableCursorStyle = true;
$('body').removeClass('measureCur');
}
});