diff options
| author | rsudev <rasch@munin-soft.de> | 2015-01-16 16:37:01 +0100 |
|---|---|---|
| committer | rsudev <rasch@munin-soft.de> | 2015-01-16 16:37:01 +0100 |
| commit | 301840361c9655815e0273f64a7f7ddf3abd37ba (patch) | |
| tree | 0deea97fa96a0b01792ad0e84cc040b332be3a84 | |
| parent | a86a99d243d7a95867b80fb87c3946ed4210beab (diff) | |
| parent | 4dab903b443f4985c4af207faf97de563304fdd6 (diff) | |
| download | cgeo-301840361c9655815e0273f64a7f7ddf3abd37ba.zip cgeo-301840361c9655815e0273f64a7f7ddf3abd37ba.tar.gz cgeo-301840361c9655815e0273f64a7f7ddf3abd37ba.tar.bz2 | |
Merge branch 'issue-2687'
| -rw-r--r-- | main/src/cgeo/geocaching/maps/CGeoMap.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java index 0fdd038..933fdbd 100644 --- a/main/src/cgeo/geocaching/maps/CGeoMap.java +++ b/main/src/cgeo/geocaching/maps/CGeoMap.java @@ -876,7 +876,12 @@ public class CGeoMap extends AbstractMap implements ViewFactory { if (restartRequired) { mapRestart(); } else if (mapView != null) { // changeMapSource can be called by onCreate() + mapStateIntent = currentMapState(); mapView.setMapSource(); + // re-center the map + centered = false; + centerMap(geocodeIntent, searchIntent, coordsIntent, mapStateIntent); + // re-build menues ActivityMixin.invalidateOptionsMenu(activity); } @@ -887,9 +892,6 @@ public class CGeoMap extends AbstractMap implements ViewFactory { * Restart the current activity with the default map source. */ private void mapRestart() { - // close old mapview - activity.finish(); - // prepare information to restart a similar view final Intent mapIntent = new Intent(activity, Settings.getMapProvider().getMapClass()); @@ -908,6 +910,9 @@ public class CGeoMap extends AbstractMap implements ViewFactory { mapIntent.putExtra(Intents.EXTRA_MAPSTATE, mapState); } + // close old map + activity.finish(); + // start the new map activity.startActivity(mapIntent); } |
