首页 / 浏览问题 / 三维GIS / 问题详情
如何获取三维模型的属性
6EXP 2019年01月08日

按照官网上的例子获取数据,添加点击事件没有反应,获取不到属性,情况如下,求告知

  var promise = scene.open(URL_CONFIG.SCENE_JINJIANG);
            Cesium.when(promise, function (layers) {
            console.log(layers)
                if(!scene.pickPositionSupported){
                    alert('不支持深度拾取,属性查询功能无法使用!');
                }
                var layer = scene.layers.find('jinjiang');
                //设置属性查询参数
                layer.setQueryParameter({
                    url: 'http://www.supermapol.com/realspace/services/data-jinjiang/rest/data',
                    dataSourceName: 'jinjiang',
                    dataSetName: 'test',
                    keyWord: 'SmID'
                });

上面是官网上的实例,scene.layers标红的地方获取的数组的个数只有一个,但是我获取的数据服务获取的scene.layers的个数是三个,我获取数组中的那个数据都不能通过点击事件获取到建筑物的属性,即使是使用layers.setQueryParameter也获取不到。

如下是我打印官网上scene.layers获取到的部分数据:

nt {_isS3MB: false, _isS3MZ: undefined, _context: U, _gl: WebGLRenderingContext, _name: "jinjiang", …

如下是我打印自己发布的服务scene.layers获取到的部分数据:

  1. (3) [nt, nt, nt]
    1. 0:nt {_isS3MB: false, _isS3MZ: undefined, _context: U, _gl: WebGLRenderingContext, _name: "DX_1K_FWM_down5_adjust@GRID_GEODB", …}
    2. 1:nt {_isS3MB: false, _isS3MZ: undefined, _context: U, _gl: WebGLRenderingContext, _name: "DX_1K_FWM_up5_adjust@GRID_GEODB", …}
    3. 2:nt {_isS3MB: false, _isS3MZ: undefined, _context: U, _gl: WebGLRenderingContext, _name: "MNG_SQ_M_adjust@GRID_SYSDB#1", …}
    4. length:3

1个回答

没明白你说的意思,获取的数据服务获取的scene.layers的个数是三个?这个是什么意思?

如果你想查询你某一个图层的属性信息,那就获取到对应的图层,然后设置对应的查询参数就可以了。

如果你是批量生成缓存的方式生成的缓存那么用范例http://support.supermap.com.cn:8090/webgl/examples/editor.html#S3MTiles_BIM

887EXP 2019年01月08日
现在没问题了,是我自己这边的服务没处理好
您好,我也遇到这种情况,模型能被选中,高亮,但是不出气泡信息,请问您是怎么解决的呀,谢谢
同样的问题,求解答
...