From 2ee1c7ef98b4a941ad55430a6fab8800afb00cca Mon Sep 17 00:00:00 2001 From: chenxianhui <chenxianhui@supermap.com> Date: Wed, 30 Oct 2024 17:42:12 +0800 Subject: [PATCH] =?UTF-8?q?ICL-1556=20=E6=95=B0=E6=8D=AE=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6:=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9D=A1=E4=BB=B6=E5=A4=B1=E6=95=88=20review?= =?UTF-8?q?=20by=20luox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataservicequery/DataServiceQueryView.js | 12 ++++-------- .../dataservicequery/DataServiceQueryViewSpec.js | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/leaflet/components/dataservicequery/DataServiceQueryView.js b/src/leaflet/components/dataservicequery/DataServiceQueryView.js index 37f32b4b3..d90cfaae5 100644 --- a/src/leaflet/components/dataservicequery/DataServiceQueryView.js +++ b/src/leaflet/components/dataservicequery/DataServiceQueryView.js @@ -461,10 +461,8 @@ export var DataServiceQueryView = ComponentsViewBase.extend({ maxFeatures: maxFeatures }); } else if (getFeatureMode === 'BOUNDS') { - if (!bounds) { - let value = JSON.parse(queryRangeTextArea.value); - bounds = L.bounds([value.leftBottom.x, value.leftBottom.y], [value.rightTop.x, value.rightTop.y]) - } + let value = JSON.parse(queryRangeTextArea.value); + bounds = L.bounds([value.leftBottom.x, value.leftBottom.y], [value.rightTop.x, value.rightTop.y]) queryParam = new GetFeaturesByBoundsParameters({ attributeFilter: attributeFilter, datasetNames: datasetArr, @@ -472,8 +470,7 @@ export var DataServiceQueryView = ComponentsViewBase.extend({ }); } else if (getFeatureMode === 'BUFFER') { let bufferDistance = bufferDistanceInput.value; - let defaultGeometryValue = JSON.parse(queryRangeTextArea.value); - let geometryLayer = resultLayer || defaultGeometryValue; + let geometryLayer = JSON.parse(queryRangeTextArea.value); queryParam = new GetFeaturesByBufferParameters({ attributeFilter: attributeFilter, datasetNames: datasetArr, @@ -482,8 +479,7 @@ export var DataServiceQueryView = ComponentsViewBase.extend({ }); } else if (getFeatureMode === 'SPATIAL') { let spatialQueryMode = spatialQueryModeSelectName.title; - let defaultGeometryValue = JSON.parse(queryRangeTextArea.value); - let geometryLayer = resultLayer || defaultGeometryValue; + let geometryLayer = JSON.parse(queryRangeTextArea.value); queryParam = new GetFeaturesByGeometryParameters({ attributeFilter: attributeFilter, datasetNames: datasetArr, diff --git a/test/leaflet/components/dataservicequery/DataServiceQueryViewSpec.js b/test/leaflet/components/dataservicequery/DataServiceQueryViewSpec.js index 377338c65..6bded68a4 100644 --- a/test/leaflet/components/dataservicequery/DataServiceQueryViewSpec.js +++ b/test/leaflet/components/dataservicequery/DataServiceQueryViewSpec.js @@ -273,7 +273,7 @@ describe('leaflet_DataServiceQuery_DataServiceQueryView', () => { map.fire('pm:create', {'shape': 'Marker', 'layer': layer.getLayers()[0]}); let boundsLayer = {"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[97.4157714844,42.7368164063],[100.5908203125,42.7917480469],[98.0529785156,41.484375],[97.4157714844,42.7368164063]]]}}; boundsLayer = L.geoJSON(boundsLayer); - map.fire('pm:create', {'shape': 'Rectangle', 'layer': boundsLayer.getLayers()[0]}); + map.fire('pm:create', {'shape': 'Polygon', 'layer': boundsLayer.getLayers()[0]}); var analysitBtn = document.getElementsByClassName('component-analysis__analysisbtn--analysis')[0]; analysitBtn.click();