我将示例中这一部分内容
替换成了以下内容,想实现画线画面后,具体数值显示在线段旁边
class MeasureHandler extends Handler {
TextPart3D textPart3D = new TextPart3D();
@Override
public void handleMessage(Message msg) {
TextStyle textStyle = new TextStyle();
textStyle.setAlignment(TextAlignment.MIDDLECENTER);
textStyle.setFontScale(2);
GeoText3D geoText3D = new GeoText3D(textPart3D);
GeoPlacemark geoPlacemark = new GeoPlacemark("3D",geoText3D);
sceneControl.getScene().getTrackingLayer().add(geoPlacemark,"geoText");
// textPart3D.dispose();
// geoText3D.dispose();
if(AnalysisTypeArea == 0){
double msgLength = Math.round(msg.getData().getDouble("length"));
if (msgLength < 1000){
textPart3D.setText("共" + msgLength + "米");
}else {
textPart3D.setText(" 共 " + Math.round(msgLength / 1000) + "公里");
}
} else if (AnalysisTypeArea == 1) {
double msgLength = Math.round(msg.getData().getDouble("Area"));
if (msgLength < 1000) {
textPart3D.setText(" 共 " + msgLength + " 平方米");
} else {
textPart3D.setText(" 共 " + Math.round(msgLength / 1000) + "平方公里");
}
}
}
}
但是运行后画线画面没有显示,想问一下是哪里有问题