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
|
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
|
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.
添加 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
否则。
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
否则。
当前 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 .