北京经济技术开发区经开区虚拟城市项目-【前端】--政府服务中心-1号屏Web
Surpriseplus
2023-10-08 f99c96adfe3ec59712cdadf88d54416c7742cc21
代码更新
已添加2个文件
已修改4个文件
171 ■■■■ 文件已修改
index.html 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/mapMsg.js 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/rpc.js 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/map/viewer.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/Polyline.js 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/SmartEarthSDK/Workers/image/1.png 补丁 | 查看 | 原始文档 | blame | 历史
index.html
@@ -15,6 +15,7 @@
  <script src="./static/SmartEarthSDK/Workers/jquery-2.0.3.js"></script>
  <script src="./static/SmartEarthSDK/SmartEarth.min.js"></script>
  <script src="./static/SmartEarthSDK/Workers/layui/layui.all.js"></script>
  <script src="./static/Polyline.js"></script>
</head>
<body oncontextmenu="return false;" ondragstart="return false;" onselectstart="return false;">
src/assets/js/mapMsg.js
@@ -1,15 +1,17 @@
import mapData from "../../../static/mapData";
import rpc from "./rpc";
import vueEvents from '@/utils/vueEvent.js'
import vueEvents from "@/utils/vueEvent.js";
window.mapMsg = {
    setTimeInterval: null,
    testMsg(res) {
        this.setMsgMatching({
            message: res,
            baidu_keys: {
                results: [{
                    word: res
                }]
                results: [
                    {
                        word: res
                    }
                ]
            }
        });
    },
@@ -19,67 +21,66 @@
            if (this.setTimeInterval) {
                clearInterval(this.setTimeInterval);
                this.setTimeInterval = null;
            }
            if (res.data.status === "ok") {
                that.setMsgMatching(res.data.params);
            }
            this.setTimeInterval = setTimeout((res) => {
            this.setTimeInterval = setTimeout(res => {
                vueEvents.$emit("queryData", false);
                rpc.setClearAllMsg();
                rpc.setLineRoaming()
                rpc.setLineRoaming();
                clearInterval(this.setTimeInterval);
                this.setTimeInterval = null;
            }, 70000)
            }, 70000);
        });
    },
    //消息匹配
    setMsgMatching(result) {
        var param = result.message;
        var rest = mapData.msgMach.rest;
        var rom = mapData.msgMach.lineRoam;
        var closeRomData = mapData.msgMach.closeRoam;
        var valRest = rest.filter((rs) => {
        var valRest = rest.filter(rs => {
            if (param.indexOf(rs) > -1) {
                return rs;
            }
        })
        });
        // åœ°å›¾å¤ä½
        if (valRest.length > 0) {
            vueEvents.$emit("queryData", false);
            rpc.setClearAllMsg();
            rpc.setMapRest();
            return
            return;
        }
        //漫游
        var valRom = rom.filter((rs) => {
        var valRom = rom.filter(rs => {
            if (param.indexOf(rs) > -1) {
                return rs;
            }
        })
        });
        if (valRom.length > 0) {
            vueEvents.$emit("queryData", false);
            rpc.setClearAllMsg();
            rpc.setLineRoaming()
            return
            rpc.setLineRoaming();
            return;
        }
        // åœæ­¢æ¼«æ¸¸
        var closeRom = closeRomData.filter((rs) => {
        var closeRom = closeRomData.filter(rs => {
            if (param.indexOf(rs) > -1) {
                return rs
                return rs;
            }
        });
        if (closeRom.length > 0) {
            rpc.setCloseLineRomaing();
            return
            return;
        }
        rpc.getFuzzyQuery(result)
    },
        rpc.getFuzzyQuery(result);
    }
};
export default mapMsg
export default mapMsg;
src/assets/js/rpc.js
@@ -208,6 +208,39 @@
                );
            }
        });
        // var positions = [
        //     108.95846,
        //     34.22104,
        //     108.96039,
        //     34.22104,
        //     108.96046,
        //     34.21804,
        //     108.95843,
        //     34.21804,
        //     108.95846,
        //     34.22104
        // ];
        // var wall = Viewer.entities.add({
        //     name: "立体墙效果",
        //     wall: {
        //         positions: Cesium.Cartesian3.fromDegreesArray(positions),
        //         material: new Cesium.DynamicWallMaterialProperty({
        //             color: Cesium.Color.RED,
        //             duration: 4000
        //         }),
        //         // è®¾ç½®é«˜åº¦
        //         maximumHeights: [20, 20, 20, 20, 20],
        //         minimumHeights: [0, 0, 0, 0, 0],
        //     }
        // })
        // setTimeout(() => {
        //     Viewer.flyTo(wall)
        // }, 20000);
    },
    // æ˜¾ç¤ºå›­åŒºèŒƒå›´
    getPark(res) {
@@ -671,7 +704,7 @@
        });
        setTimeout(() => {
            this.setClearPointFly();
        }, 5000);
        }, 8000);
    },
    changeCameraHeading(res) {
        var nextIndex = this.marksIndex + 1;
src/components/map/viewer.vue
@@ -60,7 +60,7 @@
      let that = this;
      let option = {
        fullscreenButton: true,
        licenseServer: "http://183.162.245.49:18080",
        // licenseServer: "http://183.162.245.49:18080",
        minViewHeight: parseFloat(common.minviewheight),
        // url: SmartEarthRootUrl + "Workers/image/earth.jpg",  //不含单张地图图片url则使用在线地图
        contextOptions: {
static/Polyline.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,82 @@
//动态墙材质
function DynamicWallMaterialProperty(options) {
    // é»˜è®¤å‚数设置
    this._definitionChanged = new Cesium.Event();
    this._color = undefined;
    this._colorSubscription = undefined;
    this.color = options.color;
    this.duration = options.duration;
    this.trailImage = options.trailImage;
    this._time = (new Date()).getTime();
}
Object.defineProperties(DynamicWallMaterialProperty.prototype, {
    isConstant: {
        get: function () {
            return false;
        }
    },
    definitionChanged: {
        get: function () {
            return this._definitionChanged;
        }
    },
    color: Cesium.createPropertyDescriptor('color')
});
DynamicWallMaterialProperty.prototype.getType = function (time) {
    return 'DynamicWall';
};
DynamicWallMaterialProperty.prototype.getValue = function (time, result) {
    if (!Cesium.defined(result)) {
        result = {};
    }
    result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, Cesium.Color.WHITE, result.color);
    if (this.trailImage) {
        result.image = this.trailImage;
    } else {
        result.image = Cesium.Material.DynamicWallImage
    }
    if (this.duration) {
        result.time = (((new Date()).getTime() - this._time) % this.duration) / this.duration;
    }
    Viewer.scene.requestRender();
    return result;
};
DynamicWallMaterialProperty.prototype.equals = function (other) {
    return this === other ||
        (other instanceof DynamicWallMaterialProperty &&
            Cesium.Property.equals(this._color, other._color))
};
Cesium.DynamicWallMaterialProperty = DynamicWallMaterialProperty;
Cesium.Material.DynamicWallType = 'DynamicWall';
Cesium.Material.DynamicWallImage = "/static/SmartEarthSDK/Workers/image/1.png";
Cesium.Material.DynamicWallSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n\
                                            {\n\
                                            czm_material material = czm_getDefaultMaterial(materialInput);\n\
                                            vec2 st = materialInput.st;\n\
                                            vec4 colorImage = texture2D(image, vec2(fract(st.t - time), st.t));\n\
                                            vec4 fragColor;\n\
                                            fragColor.rgb = color.rgb / 1.0;\n\
                                            fragColor = czm_gammaCorrect(fragColor);\n\
                                            material.alpha = colorImage.a * color.a;\n\
                                            material.diffuse = color.rgb;\n\
                                            material.emission = fragColor.rgb;\n\
                                            return material;\n\
                                            }";
Cesium.Material._materialCache.addMaterial(Cesium.Material.DynamicWallType, {
    fabric: {
        type: Cesium.Material.DynamicWallType,
        uniforms: {
            color: new Cesium.Color(1.0, 1.0, 1.0, 1),
            image: Cesium.Material.DynamicWallImage,
            time: 0
        },
        source: Cesium.Material.DynamicWallSource
    },
    translucent: function (material) {
        return true;
    }
});
static/SmartEarthSDK/Workers/image/1.png