GeoJsonData QML Type

A model to represent, load and save GeoJSON documents. 更多...

import 语句: import QtLocation 6.7
Since: QtLocation 6.7

特性

方法

详细描述

The GeoJsonData element reads and writes GeoJson documents (see the Wikipedia page , RFC ) from the sourceUrl . The respective data can be accessed as QVariant via the model property. The QVariant representation can be used with delegates to visualize the data or to make small modifications, e.g. adding new items with the addItem 函数。

New data can be stored with the save and saveAs 函数。

另请参阅 QGeoJson .

特性文档编制

model : QVariant [since 6.7]

A QVariant representation of the GeoJSON document that can be used to display the contents with delegates.

This property was introduced in Qt 6.7.

sourceUrl : QUrl [since 6.7]

The URL from which the GeoJSON document is read. Setting this property will change the model to represent the respective document.

This property was introduced in Qt 6.7.

方法文档编制

bool addItem ( Item item )

添加 item model GeoJsonData .

返回 true if the file was read successfully, false 否则。

void clear ()

Delete all items in the model GeoJsonData .

bool open ()

Reload the content of the file at sourceUrl .

返回 true if the file was read successfully, false 否则。

bool openUrl ( Url url )

Open the GeoJson file at url and load its content. The property sourceUrl will be set to url if the file is read successfully.

返回 true if the file was read successfully, false 否则。

bool save ()

当前 model GeoJsonData object is saved under sourceUrl .

返回 true if the file was saved successfully, false 否则。

bool saveAs ( Url url )

当前 model GeoJsonData object is saved under url sourceUrl 特性会被设为 url .

返回 true if the file was saved successfully, false 否则。

void setModelToMapContents ( MapView mapItemView )

All mapItems of mapItemView are added to the model GeoJsonData object. Previously stored mapItems are deleted from the model .

返回 true if mapItemView is set successfully, false 否则。

另请参阅 addItem .