首页 / 浏览问题 / 三维GIS / 问题详情
如何设置绘制点的样式
nk
29EXP 2021年04月01日
如何设置本地图片为绘制的点
问题关闭原因: 重新问

1个回答

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

参考:

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

                    }
                });
1,545EXP 2021年04月02日
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();

            },

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