从文件读取边界

This commit is contained in:
hm
2022-04-24 18:33:42 +08:00
parent 97cfde6aee
commit 24532b3308
2 changed files with 14 additions and 1 deletions
+13
View File
@@ -1790,6 +1790,19 @@ void OPMapWidget::WPLoad(QString path)//带文件目录参数
QJsonObject json = doc.object();
//安全区解码
QJsonArray circlesArray = json.value("geoFence").toObject().value("circles").toArray().at(0).toObject().value("circles").toArray();
for(QJsonValue item: circlesArray) {
}
QJsonArray polygonsArray = json.value("geoFence").toObject().value("polygons").toArray().at(0).toObject().value("polygon").toArray();
for(QJsonValue item: polygonsArray) {
//获得边界
qDebug() << "polygons" << item.toArray().at(0).toDouble() << item.toArray().at(1).toDouble();
}
//任务解码