public void switchToMovingMap() { CWPoint centerTo = null; if (myNavigation.isGpsPosValid()) centerTo = new CWPoint(myNavigation.gpsPos); // set gps-pos if gps is on else { // setze Zielpunkt als Ausgangspunkt, wenn GPS aus ist und lade entsprechende Karte // centerTo = new CWPoint(myNavigation.destination); if (myNavigation.destination.isValid()) centerTo = new CWPoint(myNavigation.destination); else { if (mainT.ch != null && mainT.ch.getPos().isValid()) centerTo = new CWPoint(mainT.ch.getPos()); else { if (pref.getCurCentrePt().isValid()) centerTo = new CWPoint(pref.getCurCentrePt()); } } } if (centerTo != null && centerTo.isValid()) mainT.SwitchToMovingMap(centerTo, false); else (new MessageBox( MyLocale.getMsg(321, "Error"), MyLocale.getMsg( 1513, "Cannot start moving map without valid coordinates. Please enter coordinates as destination, as center, in selected cache or start GPS"), FormBase.OKB)) .execute(); }