首页 / 浏览问题 / 三维GIS / 问题详情
Ceisum的DrawHadler绘制多边形的时候如何让他显示轮廓线呢
23EXP 2023年10月25日
handlerPolygon = new Cesium.DrawHandler(viewer, Cesium.DrawMode.Polygon);
			handlerPolygon.deactivate();
			handlerPolygon.clear();
			handlerPolygon.activate();
handlerPolygon.drawEvt.addEventListener((res: any) => {
				viewer.entities.removeById(handlerPolygon.polyline.id);
				polygonObj = res.object;
				polygonEntity = res.object.polygon;
				polygonEntity.outlineColor = new Cesium.Color(1, 1, 0, 1);
				polygonEntity.outlineWidth = 1;
				polygonEntity.material.color = new Cesium.Color(1, 0, 0, 0.6);
				commStore.changeShowEditPlot(true);
			});

我用如上的方法绘制多边形,能够绘制成功,但是没有显示出轮廓线,我想要修改轮廓线的宽度和颜色,但是看不到轮廓线,该怎么设置呢?

1个回答

您好,我已测试您提供的代码段。

您需要添加一行代码:

polygonEntity.outline=true;// 新增此行

polygonEntity.outlineColor = new Cesium.Color(1, 1, 0, 1);

polygonEntity.outlineWidth = 1;

SuperMap iClient3D for Cesium测试有效,请尝试,期待您的反馈
280EXP 2023年10月25日
十分有效,感谢!
...