1

Following code work well in Google Maps iOS SDK 1.8 but getting error in version 1.4

[mapView animateWithCameraUpdate:[GMSCameraUpdate fitBounds:bounds3]];
camera=[mapView cameraForBounds:bounds3 insets:UIEdgeInsetsZero];

CLLocationCoordinate2D mapCenter = camera.target;
camera = [GMSCameraPosition cameraWithLatitude:mapCenter.latitude
                                     longitude:mapCenter.longitude
                                          zoom:camera.zoom];

but I have to downgrade my Google Maps iOS SDK version to 1.4 to support iOS 5.1 and facing error with following line of code, Seems cameraForBounds function not available in older version.

camera=[mapView cameraForBounds:bounds3 insets:UIEdgeInsetsZero];

So anybody can suggest alternative of that?

1 Answers1

0

I solved above problem myself. Below line of code did the magic, in case anybody else facing the same issue.

[mapView animateWithCameraUpdate:[GMSCameraUpdate fitBounds:bound3 withPadding:20.0f]];