|
@ -134,28 +134,24 @@ export const queryLayersByPos = (position: any, layerList = [], cb: any) => { |
|
|
[200, 201].includes(result.status) && |
|
|
[200, 201].includes(result.status) && |
|
|
result?.data?.datasetInfos?.length > 0 |
|
|
result?.data?.datasetInfos?.length > 0 |
|
|
) { |
|
|
) { |
|
|
console.log("处理业务数据 >>>>>> ", result?.data); |
|
|
|
|
|
const fieldInfos = result.data.datasetInfos?.[0]?.fieldInfos; |
|
|
const fieldInfos = result.data.datasetInfos?.[0]?.fieldInfos; |
|
|
console.log("fieldInfos >>>>> ", fieldInfos); |
|
|
|
|
|
const currentFeature = result.data.features?.[0]; |
|
|
const currentFeature = result.data.features?.[0]; |
|
|
console.log("currentFeature >>>>> ", currentFeature); |
|
|
|
|
|
const nameIndex = fieldInfos.findIndex((f: any) => |
|
|
const nameIndex = fieldInfos.findIndex((f: any) => |
|
|
["res_name", "dike_name", "waga_name"].includes(f.name) |
|
|
["res_name", "dike_name", "waga_name"].includes(f.name) |
|
|
); |
|
|
); |
|
|
const codeIndex = fieldInfos.findIndex((f: any) => |
|
|
const codeIndex = fieldInfos.findIndex((f: any) => |
|
|
["res_code", "dike_code", "waga_code"].includes(f.name) |
|
|
["res_code", "dike_code", "waga_code"].includes(f.name) |
|
|
); |
|
|
); |
|
|
// if (layer?.fields?.length > 0) {
|
|
|
const scaleIndex = fieldInfos.findIndex((f: any) => |
|
|
// const fieldIndex = fieldInfos.findIndex((f) => f.name === layer?.fields[0]?.field);
|
|
|
["eng_scal", "dike_scale", "waga_scale"].includes(f.name) |
|
|
// code = currentFeature?.fieldValues[fieldIndex];
|
|
|
); |
|
|
// }
|
|
|
|
|
|
resData = { |
|
|
resData = { |
|
|
attributes: { |
|
|
attributes: { |
|
|
showCode: "" + currentFeature?.fieldValues[codeIndex], |
|
|
showCode: "" + currentFeature?.fieldValues[codeIndex], |
|
|
showName: "" + currentFeature?.fieldValues[nameIndex], |
|
|
showName: "" + currentFeature?.fieldValues[nameIndex], |
|
|
|
|
|
scale: "" + currentFeature?.fieldValues[scaleIndex], |
|
|
}, |
|
|
}, |
|
|
}; |
|
|
}; |
|
|
console.log("resData >>>>> ", resData); |
|
|
|
|
|
} |
|
|
} |
|
|
if (cb) cb(resData); |
|
|
if (cb) cb(resData); |
|
|
break; |
|
|
break; |
|
@ -229,7 +225,6 @@ export const getSelectedLayersLegend = (selectedLayersList: any) => { |
|
|
`${layer.url}/legend.json?bbox=${bbox}` |
|
|
`${layer.url}/legend.json?bbox=${bbox}` |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
console.log(result); |
|
|
|
|
|
if (result.status === 200 && result.data) { |
|
|
if (result.status === 200 && result.data) { |
|
|
let currentLayer = []; |
|
|
let currentLayer = []; |
|
|
// if (mapName) {
|
|
|
// if (mapName) {
|
|
|