Move map centring into separate function