summaryrefslogtreecommitdiff
path: root/src/imports/location/qdeclarativegeomap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/location/qdeclarativegeomap.cpp')
-rw-r--r--src/imports/location/qdeclarativegeomap.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/imports/location/qdeclarativegeomap.cpp b/src/imports/location/qdeclarativegeomap.cpp
index 9e2e4ebb..b627da29 100644
--- a/src/imports/location/qdeclarativegeomap.cpp
+++ b/src/imports/location/qdeclarativegeomap.cpp
@@ -187,7 +187,7 @@ QDeclarativeGeoMap::QDeclarativeGeoMap(QQuickItem *parent)
serviceProvider_(0),
mappingManager_(0),
zoomLevel_(8.0),
- center_(0,0),
+ center_(51.5073,-0.1277), //London city center
activeMapType_(0),
componentCompleted_(false),
mappingManagerInitialized_(false),
@@ -656,10 +656,10 @@ qreal QDeclarativeGeoMap::zoomLevel() const
}
/*!
-\qmlproperty coordinate QtLocation::Map::center
+ \qmlproperty coordinate QtLocation::Map::center
This property holds the coordinate which occupies the center of the
- mapping viewport.
+ mapping viewport. Invalid center coordinates are ignored.
The default value is an arbitrary valid coordinate.
*/
@@ -668,6 +668,9 @@ void QDeclarativeGeoMap::setCenter(const QGeoCoordinate &center)
if (!mappingManagerInitialized_ && center == center_)
return;
+ if (!center.isValid())
+ return;
+
center_ = center;
if (center_.isValid() && mappingManagerInitialized_) {