运行绘制时,绘制了三个点后,再无法添加点,并程序就开始无响应,其他功能也无法使用,想问一下是不是哪里有问题
private int index = -1;
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);
//1.12
TextStyle textStyle = new TextStyle();
textStyle.setAlignment(TextAlignment.MIDDLECENTER);
textStyle.setFontScale(1);
if(TotalArea > 0.0) {
Point3D innerPoint3D = tracking3DEvent.getGeometry().getInnerPoint3D();
TextPart3D textPart3D2 = new TextPart3D();
textPart3D2.setX(innerPoint3D.getX());
textPart3D2.setY(innerPoint3D.getY());
textPart3D2.setZ(innerPoint3D.getZ());
textPart3D2.setText("共" + msg.getData().getDouble("Area") + "平方米");
Log.i("测试2", "textPart3D=" + textPart3D2.getText());
if(index >= 0) {
sceneControl.getScene().getTrackingLayer().remove(index);
}
GeoText3D geoText3D = new GeoText3D(textPart3D2);
geoText3D.setTextStyle(textStyle);
GeoPlacemark geoPlacemark = new GeoPlacemark("3D", geoText3D);
index = sceneControl.getScene().getTrackingLayer().add(geoPlacemark, "面积");
}
}