绘制面的时候,想在面的中心展示结果,但现在是在每个点的位置显示,想问一下应该怎么解决,只显示最终结果就好,不用每一步的结果都显示
// 测量面积
private void measureSurearea(Tracking3DEvent tracking3DEvent) {
// 加点
// 更新测量面积
double TotalArea = tracking3DEvent.getTotalArea();
double totalcurrentlength = tracking3DEvent.getCurrentLength();
Message msg = new Message();
Bundle bundle = new Bundle();
bundle.putDouble("Area", Double.parseDouble(new DecimalFormat("############.##").format(TotalArea)));
msg.setData(bundle);
totalLengthHandler.sendMessage(msg);
Log.v("lzw", "TotalArea=" + TotalArea + ";" + "totalcurrentlength=" + totalcurrentlength);
TextStyle textStyle = new TextStyle();
textStyle.setAlignment(TextAlignment.MIDDLECENTER);
textStyle.setFontScale(1);
TextPart3D textPart3D2 = new TextPart3D();
textPart3D2.setX(tracking3DEvent.getX());
textPart3D2.setY(tracking3DEvent.getY());
textPart3D2.setZ(tracking3DEvent.getZ());
textPart3D2.setText("共" + String.valueOf(msg.getData().getDouble("Area"))+"平方米");
Log.i("测试2", "textPart3D=" + textPart3D2.getText());
GeoText3D geoText3D = new GeoText3D(textPart3D2);
geoText3D.setTextStyle(textStyle);
GeoPlacemark geoPlacemark = new GeoPlacemark("3D",geoText3D);
sceneControl.getScene().getTrackingLayer().add(geoPlacemark,"geoText");
textStyle.dispose();
textPart3D2.dispose();
geoText3D.dispose();
}