From 4f52d276034ab3e0972bb00c493bb9019b26e8e9 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期二, 30 五月 2023 14:21:42 +0800 Subject: [PATCH] 修改图层加载项目后,点击图上不触发属性框;在线制图角度设置无效;空间查询,按管线设置缓冲区,界面无法操作;在线制图,发布管理预览地图内网不显示地图修改 --- src/views/exportMap/index.vue | 66 ++++++++++++++++++++++----------- 1 files changed, 44 insertions(+), 22 deletions(-) diff --git a/src/views/exportMap/index.vue b/src/views/exportMap/index.vue index 0c94e0f..0f8b46d 100644 --- a/src/views/exportMap/index.vue +++ b/src/views/exportMap/index.vue @@ -508,7 +508,7 @@ resolution: "20绫�", date: this.getYMD(), layers: res.toString(), - rotation: this.form.role, + rotation: this.formInline.role, xmin: this.layerExtent.xmin, ymin: this.layerExtent.ymin, xmax: this.layerExtent.xmax, @@ -555,6 +555,7 @@ mapView.removeLayer(this.vector) } this.layerExtent = null + this.formInline.role = ''; }, stopDraw() { // if (this.draw !== null) { @@ -577,8 +578,8 @@ mapView.addLayer(this.vector) let type = 'Circle' - // var geometryFunction = ol.interaction.Draw.createBox(); - // console.log(geometryFunction) + // var geometryFunction = ol.interaction.Draw.createBox(); + // console.log(geometryFunction) let geometryFunction2 = createBox() this.draw = new Draw({ source: this.source, @@ -589,7 +590,7 @@ this.draw.on("drawend", e => { let feature = e.feature let geom = feature.getGeometry() - var bbox = geom.getExtent(); + var bbox = geom.getExtent(); var ss = turf.square(bbox); geom.setCoordinates([[[ss[0], ss[3]], [ss[2], ss[3]], [ss[2], ss[1]], [ss[0], ss[1]], [ss[0], ss[3]]]]); e.feature.setGeometry(geom); @@ -606,7 +607,7 @@ mapView.removeInteraction(this.draw) }) - mapView.addInteraction(this.draw); + mapView.addInteraction(this.draw); }, //缁樺埗鍥惧舰 setMapAddDraw() { @@ -743,22 +744,43 @@ }, //鍦板浘鍒濆鍖� initMap() { - var TiandiLayer = new TileLayer({ - source: new XYZ({ - url: "http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}", - }), - }) + var TiandiLayer, GaoDeLayer; + if (is_production) { + var base_ulr = window.sceneConfig.baseUrl; + if (base_ulr.indexOf('{host}') > -1) { + base_ulr = base_ulr.replace("{host}", iisHost) + } + GaoDeLayer = new TileLayer({ + title: "楂樺痉鍦板浘", + source: new XYZ({ + url: base_ulr, + wrapX: false + }) + }); + var base_ulr_sl = window.sceneConfig.baseUrl_sl; + if (base_ulr_sl.indexOf('{host}') > -1) { + base_ulr_sl = base_ulr_sl.replace("{host}", iisHost) + } + TiandiLayer = new TileLayer({ + source: new XYZ({ + url: base_ulr_sl, + }), + }) + } else { + TiandiLayer = new TileLayer({ + source: new XYZ({ + url: "http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}", + }), + }) - var GaoDeLayer = new TileLayer({ - source: new XYZ({ - url: "http://wprd01.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scl=1&style=6", - }), - }) - // var GaoDeTitle = new TileLayer({ - // source: new XYZ({ - // url: "http://wprd01.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scl=1&style=8", - // }), - // }) + GaoDeLayer = new TileLayer({ + source: new XYZ({ + url: "http://wprd01.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scl=1&style=6", + }), + }) + + } + window.mapView = new Map({ target: "mapView", layers: [TiandiLayer, GaoDeLayer], @@ -769,10 +791,10 @@ }), controls: defaultControls().extend([new FullScreen(), new ScaleLine(), new Rotate()]), }) - // console.log(mapView.getLayers().item(2)) + // console.log(mapView.getLayers().item(2)) mapView.getLayers().item(1).setVisible(false) // mapView.getLayers().item(2).setVisible(false) - + // this.formInline.role = mapView.getView().getRotation() }, //鍒囨崲搴曞浘 -- Gitblit v1.9.3