mapwidgethelper: pass a MapLocation object to QML in centerOnDiveSite()

The function in QML centerOnCoordinate() is now renamed
centerOnMapLocation() and accepts a MapLocation object, so that
a marker is selected (based on UUID).

In MapWidgetHelper::centerOnDiveSite(), the pointer to a MapLocation
is retrieved via MapLocationModel::getMapLocationForUuid(). Added in the
previous commit.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
Lubomir I. Ivanov 2017-07-19 03:06:40 +03:00 committed by Dirk Hohndel
parent 4a126b553f
commit b4740803a1
2 changed files with 5 additions and 7 deletions

View file

@ -70,10 +70,11 @@ Item {
}
}
function centerOnCoordinate(coordinate) {
map.newCenter = coordinate;
function centerOnMapLocation(mapLocation) {
map.newCenter = mapLocation.coordinate;
map.zoomLevel = 2;
mapAnimation.restart();
mapHelper.model.selectedUuid = mapLocation.uuid;
}
}
}