Commit 5b13c4b5 authored by 皮倩雯's avatar 皮倩雯

fix: '修复范围保存地图消失bug'

parent 5758b9a1
Pipeline #61717 passed with stages
...@@ -547,7 +547,6 @@ const Map = props => { ...@@ -547,7 +547,6 @@ const Map = props => {
console.log(data); console.log(data);
} }
} else { } else {
console.log(setttings.customPointExtent);
setKeepDraw(setttings.customPointExtent); setKeepDraw(setttings.customPointExtent);
} }
...@@ -666,6 +665,9 @@ const Map = props => { ...@@ -666,6 +665,9 @@ const Map = props => {
}); });
} else { } else {
setButState(false); setButState(false);
let aa = JSON.parse(form.getFieldsValue().customPointExtent);
form.setFieldsValue({ customPointExtent: aa.geometry });
console.log(form.getFieldsValue().customPointExtent.geometry);
} }
// else { // else {
// let geom = []; // let geom = [];
...@@ -722,21 +724,16 @@ const Map = props => { ...@@ -722,21 +724,16 @@ const Map = props => {
} }
let data = {}; let data = {};
console.log(obj.customPointExtent); console.log(obj.customPointExtent);
// let ab = JSON.parse(obj.customPointExtent);
// console.log(ab);
if (obj.customPointExtent) { if (obj.customPointExtent) {
if (keepBorderArea && !obj.customPointExtent.type) { if (keepBorderArea && !obj.customPointExtent.type) {
data.type = keepType; data.type = keepType;
data.geometry = obj.customPointExtent; data.geometry = obj.customPointExtent;
console.log(data); console.log(data);
} else if (keepBorderArea && obj.customPointExtent.type) {
data = obj.customPointExtent;
console.log(data);
} else if (!keepBorderArea && !obj.customPointExtent.type) { } else if (!keepBorderArea && !obj.customPointExtent.type) {
data.type = keepType; data.type = keepType;
data.geometry = obj.customPointExtent; data.geometry = obj.customPointExtent;
console.log(data); console.log(data);
} else if (!keepBorderArea && obj.customPointExtent.type) { } else {
data = obj.customPointExtent; data = obj.customPointExtent;
console.log(data); console.log(data);
} }
...@@ -871,7 +868,6 @@ const Map = props => { ...@@ -871,7 +868,6 @@ const Map = props => {
setRadio1(e.target.value); setRadio1(e.target.value);
} else { } else {
console.log(keepDraw);
if (keepDraw) { if (keepDraw) {
let area1 = form.getFieldsValue().areaName; let area1 = form.getFieldsValue().areaName;
mapRef.current.changeAreaName(area1[0], keepDraw); mapRef.current.changeAreaName(area1[0], keepDraw);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment