更改设备不能编辑

This commit is contained in:
zengmingjie 2025-07-09 09:50:34 +08:00
parent 837255691e
commit f2a0977133
2 changed files with 20 additions and 7 deletions

View File

@ -601,12 +601,25 @@ export default {
return item.geometry.coordinates;
});
geojson.coordinates = geojson.coordinates.filter(
(item) =>
Array.isArray(item) &&
Array.isArray(item[0]) &&
Array.isArray(item[0][0])
);
// geojson.coordinates
if (
Array.isArray(geojson.coordinates) &&
geojson.coordinates.length > 1
) {
//
const firstValidItem = geojson.coordinates.find(
(item) =>
Array.isArray(item) &&
// [lng, lat]
((item.length === 2 &&
typeof item[0] === "number" &&
typeof item[1] === "number") ||
//
(Array.isArray(item[0]) && Array.isArray(item[0][0])))
);
//
geojson.coordinates = firstValidItem ? [firstValidItem] : [];
}
}
this.ruleForm.geoJson = geojson;
this.ruleForm.center = [

View File

@ -336,7 +336,7 @@ export default {
},
toGeoJSON() {
if (this.typeOf === "pointP") {
// return this.graphicLayer.toGeoJSON({ noAlt: true });
return this.graphicLayer.toGeoJSON({ noAlt: true });
} else {
this.graphicLayer._graphicList._array.forEach((item) => {
if (item.type === "billboard") {