如图中的红色圆圈范围,在三维场景中,用什么方法画呀,谢谢
GeoCircle circle = new GeoCircle(new Point2D(116.457897, 39.913678), 1000); mBinding.sceneControl.getScene().getTrackingLayer().add(circle, "circle");
GeoCircle circle = new GeoCircle(new Point2D(116.45547915911735, 39.916224653382855), 10); GeoRegion region = circle.convertToRegion(4); mBinding.sceneControl.getScene().getTrackingLayer().add(region, "region");
您给看看这样有问题吗,确实显示不出来,三维里如果可以直接加二维,那高程是多少啊,是不是被挡住了
sceneControl.getScene().getTrackingLayer().add(region, "region");执行后绘制的圆面在地图上不显示,需要缩放一下才会显示是啥原因?
长按绘制圆面的方法 private void drawBufferCircle(Point pnt) { // 1.获取长按点 double distance = ll_buffer_item_seekBar.getProgress(); TrackingLayer3D trackingLayer3D = m_sceneControl.getScene().getTrackingLayer(); trackingLayer3D.clear(); Point3D pnt3d = m_sceneControl.getScene().pixelToGlobe(pnt, PixelToGlobeMode.TERRAINANDMODEL);//将屏幕点对象转换成三维点对象 Geometry3D geoPoint3D = new GeoPoint3D(pnt3d); GeoStyle3D rgstyle3D = new GeoStyle3D(); rgstyle3D.setMarkerColor(new Color(255, 0, 0)); rgstyle3D.setAltitudeMode(AltitudeMode.ABSOLUTE); geoPoint3D.setStyle3D(rgstyle3D); trackingLayer3D.add(geoPoint3D, "buffercircle"); Point2D point2D = new Point2D(pnt3d.getX(), pnt3d.getY()); GeoCircle geoCircle = new GeoCircle(point2D, distance / 5000); GeoRegion geoRegion2D = geoCircle.convertToRegion(100); //200 边形 近似圆 // GeoStyle rgstyle = new GeoStyle(); // rgstyle.setFillForeColor(new Color(255, 255, 0, 90)); // geoRegion2D.setStyle(rgstyle); // trackingLayer3D.add(geoRegion2D, "buffercircle1"); Point2Ds point2Ds = geoRegion2D.getPart(0); if (point2Ds != null && point2Ds.toArray().length > 3) { Point3Ds point3Ds = new Point3Ds(); double z = pnt3d.getZ(); for (Point2D p : point2Ds.toArray()) { Point3D point3D = new Point3D(p.getX(),p.getY(),z); point3Ds.add(point3D); } GeoRegion3D geoRegion3D = new GeoRegion3D(point3Ds); GeoStyle3D rgstyle = new GeoStyle3D(); rgstyle.setFillForeColor(new Color(255, 255, 0, 90)); rgstyle.setAltitudeMode(AltitudeMode.ABSOLUTE); geoRegion3D.setStyle3D(rgstyle); trackingLayer3D.add(geoRegion3D, "buffercircle1"); } m_sceneControl.getScene().refresh(); }
trackingLayer3D中添加二维面会出现不显示 ,缩放后显示的情况,这个情况和三维面加载到trackingLayer3D中 设置 style.setAltitudeMode(AltitudeMode.CLAMP_TO_GROUND)时的情况一样,这个setAltitudeMode(AltitudeMode.CLAMP_TO_GROUND) 和style.setAltitudeMode(AltitudeMode.ABSOLUTE);有啥差别么?在ABSOLUTE 绘制的面立即显示