首页 / 浏览问题 / 三维 / 问题详情
在使用SuperMap iClient3D for WebGL时,广告牌点击问题
4月23日, 2021

在使用SuperMap iClient3D for WebGL时,地图加载时,点位已经显示,这时是可以点击广告牌,但是只可以点击一次,等待三维地图加载完之后,广告牌可以点击,但是获取不到该广告牌的id

var handler = new Cesium.ScreenSpaceEventHandler(viewerObj.scene.canvas);
      console.log(viewerObj.scene, "viewerObjScene", "viewerId");
      handler.setInputAction((movement) => {
        console.log(movement.position, "movement", "viewerId"); 
        //可以正常获取到movement.position     G {x: 720, y: 305} "movement" "viewerId"
        var pickData = viewerObj.scene.pick(movement.position);
        console.log(pickData, "pickData", "viewerId"); //pickData为undefined 
        if (Cesium.defined(pickData) && pickData.id.id) {
          console.log(pickData.id.id, "viewerId");
          let id = pickData.id.id;
          let filterList = gifMapList.filter((i) => i.mn == id);
          console.log(filterList, "viewerId");
          _this.mapMarker(filterList[0]);
        }
      }, Cesium.ScreenSpaceEventType.LEFT_CLICK);

...