liuyg
2021-06-15 9f60aa23fc863c14b7aa8d8f00cd8c4b5542bb74
Merge branch 'master' of http://192.168.0.105:10010/r/pyhmap
5 files modified
286 ■■■■ changed files
index.html 2 ●●● patch | view | raw | blame | history
widgets/FlyRoute/flyroute.json 216 ●●●●● patch | view | raw | blame | history
widgets/LeftNavigationBar/Widget.js 10 ●●●● patch | view | raw | blame | history
widgets/Tool/Widget.js 3 ●●●● patch | view | raw | blame | history
widgets/instructions/Widget.js 55 ●●●● patch | view | raw | blame | history
index.html
@@ -13,7 +13,7 @@
    <!-- layui -->
    <script src="libs/layer/layer.js"></script>
    <!--空间分析插件turf引用-->
    <!-- <script src="libs/turf/turf.min.js"></script> -->
    <script src="libs/turf/turf.min.js"></script>
    <!-- layui -->
    <script src='libs/layui/layui/layui.js'></script>
    <link rel="stylesheet" href="libs/layui/layui/css/layui.css">
widgets/FlyRoute/flyroute.json
@@ -1,149 +1,122 @@
[{
    "name": "鄱阳湖区域漫游",
    "sites": [{
            "id": 0,
            "lgtd": 116.07058093094358,
            "lttd": 27.184663292017,
            "height": 532631.4094937699,
            "heading": 359.6129683240469,
            "pitch": -70.00710878828988,
            "roll": 360,
            "time": 6.850034082471008
        }, {
        "id": 1,
        "lgtd": 116.13696579962681,
        "lttd": 27.221462117854543,
        "height": 69625.54238025927,
        "heading": 2.770614027788599,
        "pitch": -30.468120445644498,
        "roll": 1.9149483626155542e-9,
        "time": 2.593586572472713
            "lgtd": 116.25512974333309,
            "lttd": 27.853702327099285,
            "height": 305470.9898066192,
            "heading": 359.70207852770284,
            "pitch": -69.33940061867362,
            "roll": 360,
            "time": 6.09188099321279
    }, {
        "id": 2,
        "lgtd": 116.40102040574489,
        "lttd": 27.448113006353672,
        "height": 69625.54238025789,
        "heading": 356.1734320706876,
        "pitch": -30.468120445644626,
        "roll": 0.19345233721288962,
        "time": 4.28862240235211
            "lgtd": 116.87438690284296,
            "lttd": 28.07209675928174,
            "height": 195618.08555063797,
            "heading": 335.78104347667,
            "pitch": -60.15289761069373,
            "roll": 359.9999999999998,
            "time": 3.83931030989409
    }, {
        "id": 3,
        "lgtd": 116.98970423040575,
        "lttd": 27.583473004937616,
        "height": 69625.5423802608,
        "heading": 339.3020994144722,
        "pitch": -30.468120445644548,
        "roll": 0.39282634210952483,
        "time": 4.698599153873587
            "lgtd": 117.3848954360908,
            "lttd": 28.418880183254686,
            "height": 145578.46205320535,
            "heading": 303.4664334773321,
            "pitch": -51.067133324175536,
            "roll": 0.21269261644604548,
            "time": 3.5540119827310
    }, {
        "id": 4,
        "lgtd": 117.54002942122602,
        "lttd": 27.91811725902511,
        "height": 69625.54238025965,
        "heading": 319.5189245496973,
        "pitch": -30.46812044564414,
        "roll": 0.3344651251897885,
        "time": 4.168660397496815
            "lgtd": 117.48504208464011,
            "lttd": 29.045157089042483,
            "height": 120793.91646938979,
            "heading": 268.29402900759607,
            "pitch": -50.89234760168597,
            "roll": 0.3245162423802251,
            "time": 4.41772559488863
    }, {
        "id": 5,
        "lgtd": 117.95427795010265,
        "lttd": 28.294071395230148,
        "height": 69625.54238025325,
        "heading": 298.398812496663,
        "pitch": -30.46812044564409,
        "roll": 0.2722540584948179,
        "time": 3.794001094775054
            "lgtd": 116.94437687681176,
            "lttd": 29.70740749923287,
            "height": 100271.73076036082,
            "heading": 221.68475847472152,
            "pitch": -50.73760876731254,
            "roll": 0.5294196415387289,
            "time": 3.3793924185111
    }, {
        "id": 6,
        "lgtd": 118.1492606146489,
        "lttd": 28.73940139806807,
        "height": 69625.54238025444,
        "heading": 279.37765475703765,
        "pitch": -30.468120445644853,
        "roll": 0.25206741939215377,
        "time": 5.267132599677685
            "lgtd": 116.30105729691545,
            "lttd": 29.833951091691258,
            "height": 69066.51546120155,
            "heading": 181.27648139038828,
            "pitch": -50.500089269987804,
            "roll": 0.3071825073204896,
            "time": 2.754614312861
    }, {
        "id": 7,
        "lgtd": 118.15440296043559,
        "lttd": 29.4018025509551,
        "height": 69625.54238025927,
        "heading": 253.0840095792882,
        "pitch": -30.468120445644395,
        "roll": 0.33789138605197255,
        "time": 4.795333589966117
            "lgtd": 115.77814656571745,
            "lttd": 29.58145675881515,
            "height": 69066.5154612108,
            "heading": 132.4678318250673,
            "pitch": -50.50008926998791,
            "roll": 0.38509722638949384,
            "time": 3.75766326951769
    }, {
        "id": 8,
        "lgtd": 117.864665004058,
        "lttd": 29.94983231931571,
        "height": 69625.54238026211,
        "heading": 229.65665912711376,
        "pitch": -30.46812044564353,
        "roll": 0.34147587830959975,
        "time": 3.90164393578472
            "lgtd": 115.46108315235654,
            "lttd": 28.92891807580572,
            "height": 70518.18734055498,
            "heading": 73.48401755402136,
            "pitch": -44.60008123257843,
            "roll": 0.25983005636820594,
            "time": 2.76440055039805
    }, {
        "id": 9,
        "lgtd": 117.46815991160483,
        "lttd": 30.300774486636858,
        "height": 69625.54238026975,
        "heading": 212.08224323327354,
        "pitch": -30.468120445643276,
        "roll": 0.26152078119332656,
        "time": 5.79379779551162
            "lgtd": 115.81260512558674,
            "lttd": 28.508300457565948,
            "height": 70518.18734055119,
            "heading": 34.14274724799936,
            "pitch": -44.60008123257815,
            "roll": 0.145054389072955,
            "time": 2.20971041939766
    }, {
        "id": 10,
        "lgtd": 116.70751493499984,
        "lttd": 30.618643537315116,
        "height": 69625.54238027362,
        "heading": 187.13985080112406,
        "pitch": -30.468120445643326,
        "roll": 0.2970084342106054,
        "time": 5.94380624333187
            "lgtd": 116.22128285432908,
            "lttd": 28.29725791623307,
            "height": 70518.18734055535,
            "heading": 7.109417805111491,
            "pitch": -44.60008123257818,
            "roll": 0.19844760769502565,
            "time": 2.49504989630838
    }, {
        "id": 11,
        "lgtd": 115.84830244730652,
        "lttd": 30.51167181830559,
        "height": 69625.54238026685,
        "heading": 162.0296329896802,
        "pitch": -30.46812044564381,
        "roll": 0.29065629020315314,
        "time": 6.34805274862854
            "lgtd": 116.74255382809167,
            "lttd": 28.402559624562997,
            "height": 70518.1873405681,
            "heading": -23.70028981224687,
            "pitch": -44.60008123257818,
            "roll": 0.21392949135740552,
            "time": 4.63507650428665
    }, {
        "id": 12,
        "lgtd": 115.06553239021456,
        "lttd": 30.086685971423663,
        "height": 69625.54238026496,
        "heading": 131.28469766040868,
        "pitch": -30.468120445643606,
        "roll": 0.2670512309222153,
        "time": 5.44447019439281
    }, {
        "id": 13,
        "lgtd": 114.6186439058435,
        "lttd": 29.522352771185933,
        "height": 69625.54238026099,
        "heading": 105.92597259963087,
        "pitch": -30.468120445643557,
        "roll": 0.3515198075178521,
        "time": 7.751967610067505
    }, {
        "id": 14,
        "lgtd": 114.60888241471893,
        "lttd": 28.54747058966928,
        "height": 69625.54238025077,
        "heading": 69.31583687053215,
        "pitch": -30.468120445643404,
        "roll": 0.3163993607862109,
        "time": 5.8403926688473
    }, {
        "id": 15,
        "lgtd": 114.96560043470814,
        "lttd": 27.883613737880435,
        "height": 69625.54238025342,
        "heading": 43.189625385096654,
        "pitch": -30.468120445643073,
        "roll": 0.33788219699373634,
        "time": 4.745027408869115
    }, {
        "id": 16,
        "lgtd": 115.2920604052509,
        "lttd": 27.361645264596028,
        "height": 69625.54238025373,
        "heading": 23.649506702823388,
        "pitch": -30.468120445643173,
        "roll": 0.32169504301905333,
        "time": 2.289093655343274
            "lgtd": 117.54126872910363,
            "lttd": 28.521693627213544,
            "height": 126986.38248378983,
            "heading": -63.3672603044896,
            "pitch": -47.43087935636498,
            "roll": 0.3136332255315753,
            "time": 6.916175825561835
    }]
},
{
@@ -257,4 +230,5 @@
        "roll": 0.15288734882291413,
        "time": 3
    }]
}]
    }
]
widgets/LeftNavigationBar/Widget.js
@@ -37,7 +37,7 @@
                $('.left-navigation-bar-but').click(() => {
                    this.changeImg = !this.changeImg;
                    if (this.changeImg) {
                        $('.l-n-b-b-img').attr("src", "../../images/addL/xzuo.png"); //打开
                        $('.l-n-b-b-img').attr("src", "./images/addL/xzuo.png"); //打开
                        $('.jimu-widget-LeftNavigationBar').css({
                            'left': '0px'
                        });
@@ -45,7 +45,7 @@
                            'left': '260px'
                        });
                    } else {
                        $('.l-n-b-b-img').attr("src", "../../images/addL/xyou.png"); //关闭
                        $('.l-n-b-b-img').attr("src", "./images/addL/xyou.png"); //关闭
                        $('.jimu-widget-LeftNavigationBar').css({
                            'left': '-250px'
                        });
@@ -327,18 +327,18 @@
                }
                var keyId = this.getUrlKeyId("serviceName");
                var keyId = this.getUrlKeyId("serviceId");
                if (keyId && keyId != "") {
                    for (var i = 0; i < data.length; i++) {
                        if (data[i].title == keyId) {
                        if (data[i].id == keyId) {
                            data[i].checked = true
                        }
                        for (var j = 0; j < data[i].children.length; j++) {
                            if (data[i].children[j].title == keyId) {
                            if (data[i].children[j].id == keyId) {
                                data[i].children[j].checked = true
                            }
                             
widgets/Tool/Widget.js
@@ -28,6 +28,7 @@
            name: 'Tool',
            layers: {},
            startup: function () {
                var that = this;
                // 暴露在外的接口
                topic.subscribe("closeTool", lang.hitch(this, this.closeToolBox));
                this.inherited(arguments);
@@ -39,7 +40,7 @@
                // 图上量算
                $('.measure-tool').click(function () {
                    that.map.scene.globe.depthTestAgainstTerrain = false;
                    // 关闭卷帘
                    topic.publish('closeRolling', 'Rolling');
                    // 关闭分屏
widgets/instructions/Widget.js
@@ -29,10 +29,9 @@
            layers: {},
            startup: function () {
                // 暴露在外的接口
                var that = this
                    , url = 'http://171.34.76.171:8880/pyh-station/metaWetlandProtect/queryNameAndIdAssembleMap'
                    , token = "Bearer eyJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJlY2hpc2FuIiwic3ViIjoiYWRtaW4iLCJpYXQiOjE2MjMzOTIwNTcsImV4cCI6MTYyNTk4NDA1N30.wyhtQWDfyBM4Wvu9x_GpzWErqDkZ3J-PWEjyzoaHT9w6mMBenso5q0ZdnFueCZaCOjsHM5AMwLawATT0Zqc4aQ"
                    ;
                var that = this,
                    url = 'http://171.34.76.171:8880/pyh-station/metaWetlandProtect/queryNameAndIdAssembleMap',
                    token = "Bearer eyJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJlY2hpc2FuIiwic3ViIjoiYWRtaW4iLCJpYXQiOjE2MjMzOTIwNTcsImV4cCI6MTYyNTk4NDA1N30.wyhtQWDfyBM4Wvu9x_GpzWErqDkZ3J-PWEjyzoaHT9w6mMBenso5q0ZdnFueCZaCOjsHM5AMwLawATT0Zqc4aQ";
                axios.get(url, {
                    headers: {
                        "token": token
@@ -64,42 +63,50 @@
                    
                }
                layui.use(['dropdown', 'util', 'layer', 'table'], function () {
                    var dropdown = layui.dropdown
                        , util = layui.util
                        , layer = layui.layer
                        , table = layui.table
                        , $ = layui.jquery;
                    var dropdown = layui.dropdown,
                        util = layui.util,
                        layer = layui.layer,
                        table = layui.table,
                        $ = layui.jquery;
                    dropdown.render({
                        elem: '.demo1'
                        , data: d
                        ,trigger: 'hover'
                        , className: 'site-dropdown-demo'
                        , click: function (obj) {
                        elem: '.demo1',
                        data: d,
                        trigger: 'hover',
                        className: 'site-dropdown-demo',
                        click: function (obj) {
                            //点击事件
                            // layer.tips('点击了:' + obj.title, this.elem, { tips: [1, '#5FB878'] })
                            var str = obj.title;
                        
                            $('.jimu-widget-instructions').find('.instructions-title').empty().append(str);
                            if (that[obj.id]) {
                                that.map.imageryLayers.remove(that[obj.id]);
                            console.log(d, obj, 684)
                            for (var i = 0; i < d.length; i++) {
                                if (that['layer' + d[i].id]) {
                                    that.map.imageryLayers.remove(that['layer' + d[i].id]);
                                }
                            }
                            if (obj.src) {
                                $.ajax({
                                    url: res.data[i].seviceUrl + '/maps.json',
                                    url: obj.src + '/maps.json',
                                    type: 'get',
                                    dataType: 'JSON',
                                    success: function (result) {
                                        console.log(res.data[i])
                                        that[res.data[i].id] = that.map.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
                                        that['layer' + obj.id] = that.map.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
                                            url:  result[0].path,
                                        }));
                                        that[res.data[i].id].alpha = 1
                                        that['layer' + obj.id].alpha = 1;
                                        that['layer' + obj.id].getViewableRectangle().then(function (rectangle) {
                                            return that.map.camera.flyTo({
                                                destination: rectangle
                                            });
                                        });
                                    }
                                })
@@ -124,8 +131,7 @@
                    });
                });
            },
            closeToolBox: function (item) {
            },
            closeToolBox: function (item) {},
            onOpen: function () {
                //面板打开的时候触发 (when open this panel trigger)
@@ -146,8 +152,7 @@
            resize: function () {
            },
            begin: function () {
            },
            begin: function () {},
            destroy: function () {
                //销毁的时候触发