From afd3fe35aeaae4f3984c94ca29d57b5a3a52107f Mon Sep 17 00:00:00 2001 From: suerprisePlus <15810472099@163.com> Date: 星期二, 15 十月 2024 10:24:39 +0800 Subject: [PATCH] websocket接口对接 --- src/components/mapOl/index.vue | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/components/mapOl/index.vue b/src/components/mapOl/index.vue index ae520c5..27ed908 100644 --- a/src/components/mapOl/index.vue +++ b/src/components/mapOl/index.vue @@ -61,7 +61,7 @@ initOlMap() { const baseLayer = mapData.baseLayer; const vecUrl = baseLayer.sUrl + baseLayer.vecLayer + baseLayer.lUrl - const geo= config.geoServer; + const geo = config.geoServer; var vectorLayer = new TileLayer({ source: new XYZ({ url: vecUrl + config.tdToken, @@ -96,7 +96,7 @@ }), }); -console.log(geo.url + geo.wms) + var layer2 = new Image({ name: "Wms_Layer", source: new ImageWMS({ @@ -113,12 +113,17 @@ if (this.parentData) { if (this.parentData.indexOf('type') > -1) { const data = JSON.parse(this.parentData)[0]; + + console.log(data); + this.isShow = data.isShow if (data.type == 'point') { - const obj = mapConfig.getWKTParse(data.val.point) + + const obj = data.val.point.split(" "); + console.log(obj); this.formInline = { - lon: obj.coordinates[0], - lat: obj.coordinates[1], + lon: obj[0], + lat: obj[1], } this.addPointData(obj); } else if (data.type == 'line') { @@ -176,12 +181,12 @@ this.mapol.addLayer(vectorLayer); this.mapol.getView().fit(extent, { size: this.mapol.getSize(), - padding: [100, 100,200,100], // 鍥涗釜鏂瑰悜鐨勮竟璺濓紝鍙�� + padding: [100, 100, 200, 100], // 鍥涗釜鏂瑰悜鐨勮竟璺濓紝鍙�� constrainResolution: false, // 鏄惁闄愬埗鍒嗚鲸鐜囷紝鍙�� }); }, addPointData(res) { - const coord = res.coordinates; + const coord = res; const urlImg = config.sdkImg + 'Workers/image/mark.png'; var geom = transform( -- Gitblit v1.9.3