From b4584b1b312fb41aec696cf50958258217de4592 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Mon, 7 Mar 2011 22:19:13 +0000 Subject: [PATCH] [iPhone 4] Fixed viewport saving when app goes to background --- iphone/Maps/Classes/MapViewController.hpp | 1 + iphone/Maps/Classes/MapViewController.mm | 6 ++++++ iphone/Maps/Classes/MapsAppDelegate.mm | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/iphone/Maps/Classes/MapViewController.hpp b/iphone/Maps/Classes/MapViewController.hpp index 9ba43d7bda..6a0f779c5b 100644 --- a/iphone/Maps/Classes/MapViewController.hpp +++ b/iphone/Maps/Classes/MapViewController.hpp @@ -42,5 +42,6 @@ withConfidenceRadius: (double) confidenceRadius // called when app is terminated by system - (void) OnTerminate; +- (void) OnEnterBackground; @end diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index 3d7708255f..e31bb499e7 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -299,6 +299,11 @@ NSInteger compareAddress(UITouch * l, UITouch * r, void * context) } - (void) OnTerminate +{ + [self OnEnterBackground]; +} + +- (void) OnEnterBackground { if (m_framework) { // save world rect for next launch @@ -306,4 +311,5 @@ NSInteger compareAddress(UITouch * l, UITouch * r, void * context) } } + @end diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm index d869497a42..08318520c1 100644 --- a/iphone/Maps/Classes/MapsAppDelegate.mm +++ b/iphone/Maps/Classes/MapsAppDelegate.mm @@ -12,6 +12,11 @@ [mapViewController OnTerminate]; } +- (void) applicationDidEnterBackground: (UIApplication *) application +{ + [mapViewController OnEnterBackground]; +} + - (void) applicationDidFinishLaunching: (UIApplication *) application { // Add the tab bar controller's current view as a subview of the window