7#include <QtLocation/private/qgeojson_p.h>
16 return !
props.isNull();
41 ls[
QStringLiteral(
"properties")] = mapPolygon->property(
"props").toMap();
51 ls[
QStringLiteral(
"properties")] = mapPolyline->property(
"props").toMap();
60 QVariantMap propMap = mapCircle->property(
"props").toMap();
73 poly.addCoordinate(rectanlge.topRight());
74 poly.addCoordinate(rectanlge.bottomRight());
75 poly.addCoordinate(rectanlge.bottomLeft());
78 pt[
QStringLiteral(
"properties")] = mapRectangle->property(
"props").toMap();
176 if (
auto *polyline = qobject_cast<QDeclarativePolylineMapItem *>(
item))
178 else if (
auto *
polygon = qobject_cast<QDeclarativePolygonMapItem *>(
item))
180 else if (
auto *circle = qobject_cast<QDeclarativeCircleMapItem *>(
item))
182 else if (
auto *rectangle = qobject_cast<QDeclarativeRectangleMapItem *>(
item))
188 if (!geoJson.isEmpty()){
194 geoJson.append(
entry);
225 qWarning() <<
"Error while opening the file: " <<
url;
275 return dumpGeoJSON(m_content.
toList(), m_url);
291 m_content = toVariant(
map);
304 const QList<QObject*> mapChildren =
map->children();
307 if (mapItemAsVariant.isValid())
308 res.append(mapItemAsVariant);
324 jsonFile.write(json.
toJson());
341 debugFile.write(prettyPrint.
toUtf8());
Q_INVOKABLE bool save()
\qmlmethod bool QtLocation::GeoJsonData::save()
Q_INVOKABLE bool saveAs(const QUrl &url)
\qmlmethod bool QtLocation::GeoJsonData::saveAs(Url url)
Q_INVOKABLE bool openUrl(const QUrl &url)
\qmlmethod bool QtLocation::GeoJsonData::openUrl(Url url)
void setModel(const QVariant &model)
Q_INVOKABLE void setModelToMapContents(QDeclarativeGeoMap *map)
\qmlmethod void QtLocation::GeoJsonData::setModelToMapContents(MapView mapItemView)
Q_INVOKABLE void clear()
\qmlmethod void QtLocation::GeoJsonData::clear()
Q_INVOKABLE void addItem(QQuickItem *item)
\qmlmethod bool QtLocation::GeoJsonData::addItem(Item item)
QDeclarativeGeoJsonData(QObject *parent=nullptr)
\qmltype GeoJsonData \instantiates QDeclarativeGeoJsonData \inqmlmodule QtLocation
virtual ~QDeclarativeGeoJsonData()
Q_INVOKABLE bool open()
\qmlmethod bool QtLocation::GeoJsonData::open()
QFILE_MAYBE_NODISCARD bool open(OpenMode flags) override
Opens the file using OpenMode mode, returning true if successful; otherwise false.
Q_INVOKABLE void addCoordinate(const QGeoCoordinate &coordinate)
Appends coordinate to the polygon.
QByteArray readAll()
Reads all remaining data from the device, and returns it as a byte array.
QString errorString() const
Returns a human-readable description of the last device error that occurred.
\inmodule QtCore\reentrant
QByteArray toJson(JsonFormat format=Indented) const
static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error=nullptr)
Parses json as a UTF-8 encoded JSON document, and creates a QJsonDocument from it.
QList< T > toList() const noexcept
void append(parameter_type t)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QByteArray toUtf8() const &
QString toLocalFile() const
Returns the path of this URL formatted as a local file path.
QList< QVariant > toList() const
Returns the variant as a QVariantList if the variant has userType() \l QMetaType::QVariantList.
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
QMap< QString, QString > map
[6]
QVariantList importGeoJson(const QJsonDocument &geoJson)
This method imports the geoJson document, expected to contain valid GeoJSON data, into a QVariantList...
QJsonDocument exportGeoJson(const QVariantList &geoData)
This method exports the QVariantList geoData, expected to be structured like described in the section...
QString toString(const QVariantList &geoData)
This method accepts the QVariantList geoData, structured as described in \l {Importing GeoJSON},...
Combined button and popup list for selecting options.
QList< QVariant > QVariantList
GLenum GLuint GLsizei const GLenum * props
#define QStringLiteral(str)
QSqlQueryModel * model
[16]
QUrl url("example.com")
[constructor-url-reference]
value toMap().value(key)
[3]
\inmodule QtCore\reentrant
QString errorString() const
\variable QJsonParseError::error