summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativegeomap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeomap.cpp')
-rw-r--r--src/location/declarativemaps/qdeclarativegeomap.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp
index 604b0c46..8ab29c1a 100644
--- a/src/location/declarativemaps/qdeclarativegeomap.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomap.cpp
@@ -159,12 +159,6 @@ QT_BEGIN_NAMESPACE
application should open the link in a browser or display its contents to the user.
*/
-/*!
- \qmlsignal QtLocation::Map::initialized()
-
- This signal is emitted when the initialization of the map is complete.
-*/
-
QDeclarativeGeoMap::QDeclarativeGeoMap(QQuickItem *parent)
: QQuickItem(parent),
m_plugin(0),
@@ -424,7 +418,7 @@ void QDeclarativeGeoMap::initialize()
if (fovHasChanged)
emit fieldOfViewChanged(m_cameraData.fieldOfView());
- emit initialized();
+ emit mapReadyChanged(true);
}
/*!
@@ -1330,6 +1324,21 @@ QColor QDeclarativeGeoMap::color() const
return m_color;
}
+/*!
+ \qmlproperty color QtLocation::Map::mapReady
+
+ This property holds whether the map has been successfully initialized and is ready to be used.
+ Some methods, such as \l fromCoordinate and \l toCoordinate, will not work before the map is ready.
+ Due to the architecture of the \l Map, it's advised to use the signal emitted for this property
+ in place of \l Component.onCompleted, to make sure that everything behaves as expected.
+
+ \since 5.9
+*/
+bool QDeclarativeGeoMap::mapReady() const
+{
+ return m_initialized;
+}
+
// TODO: offer the possibility to specify the margins.
void QDeclarativeGeoMap::fitViewportToGeoShape()
{