首页 / 浏览问题 / 三维GIS / 问题详情
webgl一个工作空间中的多个数据源点选查询
216EXP 2019年08月05日

SuperMap webgl不能实现多多个数据源的多个数据集进行查询(http://qa.supermap.com/47618),通过验证,也不能实现对一个工作空间中的多个数据源进行点选查询

<script type="text/javascript">
    function onload(Cesium) {
        var infoboxContainer = document.getElementById("bubble");
        //Initializing viewer
        var viewer = new Cesium.Viewer('cesiumContainer',{
            imageryProvider: new Cesium.BingMapsImageryProvider({
                url : 'https://dev.virtualearth.net',
                mapStyle : Cesium.BingMapsStyle.AERIAL,
                key : URL_CONFIG.BING_MAP_KEY
            })
        });


        viewer.customInfobox = infoboxContainer;
        var scene = viewer.scene;
        var canvas = scene.canvas;
        var widget = viewer.cesiumWidget;
        $('#loadingbar').remove();
        try {

            //TODO:测试5
            var promise = scene.open("http://localhost:8090/iserver/services/3D-Scene4/rest/realspace");
            // var promise = scene.open("http://localhost:8090/iserver/services/3D-Scene2/rest/realspace");
            // var promise = scene.open("http://11.125.1.17:8090/iserver/services/3D-Scene2/rest/realspace");


            Cesium.when(promise, function (layers) {
                if(!scene.pickPositionSupported){
                    alert('不支持深度拾取,属性查询功能无法使用!');
                }
                // var layer = scene.layers.find('S3mConfig');
                // //set Query parameter
                // layer.setQueryParameter({
                //     // url: 'http://www.supermapol.com/realspace/services/data-jinjiang/rest/data',
                //     url: 'http://10.219.245.97:8090/iserver/services/3D-dgqxsy0307/rest/data',
                //     dataSourceName: 'S3mConfig',
                //     dataSetName: 'test',
                //     keyWord: 'SmID'
                // });

                // 1. 飞向通过top-down视图表示的位置
                viewer.camera.flyTo({
                    destination : Cesium.Cartesian3.fromDegrees(114.09, 22.8, 2500.0)
                });

                var testLayer = viewer.scene.layers;


                for (var i = 0; i < layers.length; i++) {
                    var strLayer = scene.layers.findByIndex(i).name;
                    var layer = scene.layers.find(strLayer);
                    var str_before = strLayer.split("@")[0];
                    //设置属性查询参数
                    layer.setQueryParameter({
                        // url: 'http://www.localhost:8090/iserver/services/data-scene2/rest/data',
                        // dataSourceName: 'pipe3DGIfObj',
                        // // url: 'http://www.localhost:8090/iserver/services/data-scene/rest/data',
                        // // dataSourceName: 'DGGW20190304',
                        // // dataSetName: str_before,
                        // dataSetName: "ZTT@pipe",
                        // keyWord: 'SmID'
                        url: 'http://localhost:8090/iserver/services/data-TXZTotal/rest/data',
                        dataSourceName: 'TXZTotal',
                        // dataSourceName: 'TXZSJ0731',
                        dataSetName: str_before,
                        // dataSetName: "ZTT@pipe",
                        keyWord: 'SmID'
                    });
                }

                // console.log(testLayer);
                // console.log("*********************************************");
                for (var i = 0; i < layers.length; i++) {
                    var strLayer = scene.layers.findByIndex(i).name;
                    var layer = scene.layers.find(strLayer);
                    var str_before = strLayer.split("@")[0];
                    //设置属性查询参数
                    layer.setQueryParameter({
                        // url: 'http://www.localhost:8090/iserver/services/data-scene2/rest/data',
                        // dataSourceName: 'pipe3DGIfObj',
                        // // url: 'http://www.localhost:8090/iserver/services/data-scene/rest/data',
                        // // dataSourceName: 'DGGW20190304',
                        // // dataSetName: str_before,
                        // dataSetName: "ZTT@pipe",
                        // keyWord: 'SmID'
                        url: 'http://localhost:8090/iserver/services/data-TXZTotal/rest/data',
                        // url: 'http://10.219.245.97:8090/iserver/services/data-Scene/rest/data',
                        // url: 'http://www.localhost:8090/iserver/services/data-scene/rest/data',
                        // dataSourceName: 'DGGW20190304',
                        // dataSourceName: 'TXZTotal',
                        dataSourceName: 'TXZSJ0731',
                        dataSetName: str_before,
                        // dataSetName: "ZTT@pipe",
                        keyWord: 'SmID'
                    });
                }
                //Set camera view
               scene.camera.setView({
                    //Convert the coordinates of longitude, latitude, and altitude to Cartesian coordinates
                    // destination : new Cesium.Cartesian3(-2767302.844416157,5085941.49155452,2675759.1559041184),
                    destination : new Cesium.Cartesian3(511784,2521101,0),
                    orientation : {
                       heading : 4.7793869967010565,
                       pitch : -0.5899023527373464,
                       roll : 8.539835505416704e-12
                   }
                });


            }, function (e) {
                if (widget._showRenderLoopErrors) {
                    var title = 'An error occurred while rendering.  Rendering has stopped.';
                    widget.showErrorPanel(title, undefined, e);
                }
            });
        }
        catch (e) {
            if (widget._showRenderLoopErrors) {
                var title = 'An error occurred while rendering.  Rendering has stopped.';
                widget.showErrorPanel(title, undefined, e);
            }
        }
        //Add a custom infobox
        var title = document.getElementById("title");
        var des = document.getElementById("des");
        var myimg = document.getElementById("myimg");
        //Register a mouse click event
        viewer.pickEvent.addEventListener(function(feature){
            var title = Cesium.defaultValue(feature.NAME,'');
            var description = Cesium.defaultValue(feature.DES,'');
            title.innerText = title;
            des.innerText = description;
            myimg.src = "./images/" + title + ".jpg";
        });

    }
</script>

请问:有什么办法能解决这两个问题(或者其中的任意一个)???

1个回答

如果您是一个缓存的话,现在支持对一个数据源下的多个数据集进行查询,不可以对多个数据源查询的。

一般来说一个缓存内的数据都会在一个数据源下的
6,215EXP 2019年08月05日
...