MapItemView QML Type
The MapItemView is used to populate Map from a model. More...
Import Statement: | import QtLocation 5.3 |
Since: | Qt Location 5.0 |
Properties
- autoFitViewport : Component
- delegate : Component
- model : model
Detailed Description
The MapItemView is used to populate Map with MapItems from a model. The MapItemView type only makes sense when contained in a Map, meaning that it has no standalone presentation.
Example Usage
This example demonstrates how to use the MapViewItem object to display a route on a map:
import QtQuick 2.0 import QtLocation 5.3 Map { RouteModel { id: routeModel } MapItemView { model: routeModel delegate: routeDelegate } Component { id: routeDelegate MapRoute { route: routeData line.color: "blue" line.width: 5 smooth: true opacity: 0.8 } } }
Property Documentation
autoFitViewport : Component |
This property controls whether to automatically pan and zoom the viewport to display all map items when items are added or removed.
Defaults to false.
delegate : Component |
This property holds the delegate which defines how each item in the model should be displayed. The Component must contain exactly one MapItem -derived object as the root object.
model : model |
This property holds the model that provides data used for creating the map items defined by the delegate. Only QAbstractItemModel based models are supported.
© 2015 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.