更改设备不能编辑

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; return item.geometry.coordinates;
}); });
geojson.coordinates = geojson.coordinates.filter( // geojson.coordinates
(item) => if (
Array.isArray(item) && Array.isArray(geojson.coordinates) &&
Array.isArray(item[0]) && geojson.coordinates.length > 1
Array.isArray(item[0][0]) ) {
); //
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.geoJson = geojson;
this.ruleForm.center = [ this.ruleForm.center = [

View File

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