如何设置绘制点的样式 [已关闭]

0 投票
如何设置本地图片为绘制的点
问题关闭原因: 重新问
4月 1 分类:  101次浏览 | 用户: nk 初出茅庐 (29 分)
已关闭 4月 6 用户:nk

1个回答

0 投票
您好,您可以用viewer.entities.add的方式,把图片放在billboard中,

参考:

      viewer.entities.add({
                    position: Cesium.Cartesian3.fromDegrees(longitude,latitude,height),
                    billboard: {
                        image: './images/location4.png',
                        width: 30,
                        height: 40,

                    }
                });
4月 2 用户: KeineAhnung 名扬四海 (1,542 分)
point() {

                handlerPoint.activeEvt.addEventListener(function (isActive) {

                    if (isActive == true) {

                        viewer.enableCursorStyle = false;

                        viewer._element.style.cursor = '';

                        $('body').removeClass('drawCur').addClass('drawCur');

                        viewer.entities.add({

                            billboard: {

                                image: '~@/assets/image/side_1.png',

                                width: 30,

                                height: 40,

                            }

                        });

                    }

                    else {

                        viewer.enableCursorStyle = true;

                        $('body').removeClass('drawCur');

                    }

                });

                handlerPoint.movingEvt.addEventListener(function (windowPosition) {

                    tooltip.showAt(windowPosition, '<p>点击绘制一个点</p>');

                });

                handlerPoint.drawEvt.addEventListener(function (result) {

                    tooltip.setVisible(false);

                });

                this.deactiveAll();

                handlerPoint.activate();

            },

我这么写设置它的样式会冲突吗
...