| | |
| | | var cartographic = Cesium.Cartographic.fromCartesian(position); |
| | | let lng = Cesium.Math.toDegrees(cartographic.longitude); |
| | | let lat = Cesium.Math.toDegrees(cartographic.latitude); |
| | | this.$emit("fromChlid", { lng, lat }); |
| | | this.$emit('fromChlid', { lng, lat }); |
| | | if (this.entity !== null) { |
| | | this.entity.position = Cesium.Cartesian3.fromDegrees(lng, lat); |
| | | } else { |
| | |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.viewer = new Cesium.Viewer("cesiumContainer", { |
| | | this.viewer = new Cesium.Viewer('cesiumContainer', { |
| | | animation: false, //是否创建动画小器件,左下角仪表 |
| | | baseLayerPicker: false, //是否显示图层选择器 |
| | | fullscreenButton: false, //是否显示全屏按钮 |
| | |
| | | scene3DOnly: true, //如果设置为true,则所有几何图形以3D模式绘制以节约GPU资源 |
| | | CreditsDisplay: false, //展示数据版权属性 |
| | | imageryProvider: new Cesium.UrlTemplateImageryProvider({ |
| | | url: "./earth/{z}/{x}/{reverseY}.jpeg", |
| | | url: './earth/{z}/{x}/{reverseY}.jpeg', |
| | | minimumLevel: 0, |
| | | maximumLevel: 6, |
| | | }), |
| | |
| | | // // url: 'http://103.85.171.154:60080/gisserver/tmsserver/earth_tms/{z}/{x}/{reverseY}.jpeg"' |
| | | // // }), |
| | | }); |
| | | this.viewer._cesiumWidget._creditContainer.style.display = "none"; |
| | | this.viewer._cesiumWidget._creditContainer.style.display = 'none'; |
| | | this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas); |
| | | var urls1 = `./beijingmtg`; |
| | | var urls2 = `./map`; |
| | |
| | | // "" |
| | | // ); |
| | | var urlTemplateImageryProvider = new Cesium.UrlTemplateImageryProvider({ |
| | | url: urls1 + "/{z}/{x}/{y}.png", |
| | | url: urls1 + '/{z}/{x}/{y}.png', |
| | | }); |
| | | this.viewer.imageryLayers.addImageryProvider(urlTemplateImageryProvider); |
| | | |
| | |
| | | }, |
| | | makeBill(lng, lat) { |
| | | this.entity = this.viewer.entities.add({ |
| | | name: "点", |
| | | name: '点', |
| | | position: Cesium.Cartesian3.fromDegrees(lng, lat), |
| | | billboard: { |
| | | image: "./img/jjd.png", |
| | | image: './img/jjd.png', |
| | | scale: 1, |
| | | distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0.1), |
| | | verticalOrigin: Cesium.VerticalOrigin.BOTTOM, //垂直位置 |
| | |
| | | }, |
| | | //重新绘制对象 |
| | | redrawPlotting(node) { |
| | | // debugger; |
| | | this.element = node; |
| | | if (this.element.type == "polyline") { |
| | | if (this.element.type == 'polyline') { |
| | | //定义折线几何 |
| | | var mypolyline = new Cesium.PolylineGraphics({ |
| | | positions: Cesium.Cartesian3.fromDegreesArray(this.element.positions), |
| | |
| | | // range: alt, |
| | | // }, |
| | | }); |
| | | } else if (this.element.type == "label") { |
| | | } else if (this.element.type == 'label') { |
| | | let entity = this.viewer.entities.add({ |
| | | name: this.element.name, |
| | | position: Cesium.Cartesian3.fromDegrees( |
| | |
| | | ); |
| | | } |
| | | // this.viewer.Creator.SimpleGraphic.SimpleGraphicObj.push(entity.id); |
| | | } else if (this.element.type == "billboard") { |
| | | } else if (this.element.type == 'billboard') { |
| | | let entity = this.viewer.entities.add({ |
| | | name: this.element.name, |
| | | position: Cesium.Cartesian3.fromDegrees( |
| | |
| | | // range: alt, |
| | | // }, |
| | | }); |
| | | if (this.element.width != "") |
| | | if (this.element.width != '') |
| | | entity.billboard.width = this.element.width; |
| | | if (this.element.height != "") |
| | | if (this.element.height != '') |
| | | entity.billboard.width = this.element.height; |
| | | if (this.element.rotate != "") |
| | | if (this.element.rotate != '') |
| | | entity.billboard.rotation = this.element.rotate; |
| | | // this.viewer.Creator.SimpleGraphic.SimpleGraphicObj.push(entity.id); |
| | | } else if (this.element.type == "polygon") { |
| | | } else if (this.element.type == 'polygon') { |
| | | var myPolygon1 = new Cesium.PolygonGraphics({ |
| | | hierarchy: Cesium.Cartesian3.fromDegreesArray(this.element.positions), |
| | | material: new Cesium.Color( |
| | |
| | | }); |
| | | if (this.element.isborder) { |
| | | polygonshow.polygon.outline = true; |
| | | if (this.element.bordersize == "") |
| | | if (this.element.bordersize == '') |
| | | polygonshow.polygon.outlineWidth = 1; |
| | | else polygonshow.polygon.outlineWidth = this.element.bordersize; |
| | | polygonshow.polygon.outlineColor = new Cesium.Color( |
| | |
| | | } |
| | | // this.viewer.Creator.SimpleGraphic.SimpleGraphicObj.push(polygonshow.id); |
| | | } else if ( |
| | | this.element.type == "SwallowtailArrow" || |
| | | this.element.type == "StraightArrow" || |
| | | this.element.type == "PincerArrow" || |
| | | this.element.type == "GatheringPlace" |
| | | this.element.type == 'SwallowtailArrow' || |
| | | this.element.type == 'StraightArrow' || |
| | | this.element.type == 'PincerArrow' || |
| | | this.element.type == 'GatheringPlace' |
| | | ) { |
| | | var myPolygon1 = new Cesium.PolygonGraphics({ |
| | | hierarchy: Cesium.Cartesian3.fromDegreesArray(this.element.positions), |