| | |
| | | <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;"> |
| | |
| | | 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: [{ |
| | | results: [ |
| | | { |
| | | word: res |
| | | }] |
| | | } |
| | | ] |
| | | } |
| | | }); |
| | | }, |
| | |
| | | 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; |
| | | |
| | |
| | | ); |
| | | } |
| | | }); |
| | | |
| | | // 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) { |
| | |
| | | }); |
| | | setTimeout(() => { |
| | | this.setClearPointFly(); |
| | | }, 5000); |
| | | }, 8000); |
| | | }, |
| | | changeCameraHeading(res) { |
| | | var nextIndex = this.marksIndex + 1; |
| | |
| | | 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: { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | |
| | | |
| | | //å¨æå¢æè´¨ |
| | | 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; |
| | | } |
| | | }); |