summaryrefslogtreecommitdiffstats
path: root/map-widget
diff options
context:
space:
mode:
Diffstat (limited to 'map-widget')
-rw-r--r--map-widget/qmlmapwidgethelper.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/map-widget/qmlmapwidgethelper.cpp b/map-widget/qmlmapwidgethelper.cpp
index ba197f63f..1c0469c4a 100644
--- a/map-widget/qmlmapwidgethelper.cpp
+++ b/map-widget/qmlmapwidgethelper.cpp
@@ -231,11 +231,9 @@ void MapWidgetHelper::setEditMode(bool editMode)
MapLocation *exists = m_mapLocationModel->getMapLocationForUuid(displayed_dive_site.uuid);
// if divesite uuid doesn't exist in the model, add a new MapLocation.
if (editMode && !exists) {
- QGeoCoordinate coord(0.0, 0.0);
+ QGeoCoordinate coord = m_map->property("center").value<QGeoCoordinate>();
m_mapLocationModel->add(new MapLocation(displayed_dive_site.uuid, coord,
QString(displayed_dive_site.name)));
- QMetaObject::invokeMethod(m_map, "centerOnCoordinate",
- Q_ARG(QVariant, QVariant::fromValue(coord)));
}
emit editModeChanged();
}