diff --git a/map-widget/qmlmapwidgethelper.cpp b/map-widget/qmlmapwidgethelper.cpp index a0062db6b..aad201722 100644 --- a/map-widget/qmlmapwidgethelper.cpp +++ b/map-widget/qmlmapwidgethelper.cpp @@ -288,7 +288,9 @@ void MapWidgetHelper::enterEditMode(struct dive_site *ds) QGeoCoordinate coord; // if divesite doesn't exist in the model, add a new MapLocation. if (!exists) { - coord = m_map->property("center").value(); + // If the dive site doesn't have a GPS location, use the centre of the map + coord = has_location(&ds->location) ? getCoordinates(ds) + : m_map->property("center").value(); m_mapLocationModel->add(new MapLocation(ds, coord, QString(ds->name))); } else { coord = exists->coordinate();