I got stuck on this. I hope someone can give me the right input!
I'm showing points of interest (GMSMarkers) using a GMSMapview.
At the moment I'm just centering the map on the current POI coordinate using this code (DEFAULT_ZOOM is 15.f):
GMSCameraPosition *newPosition =
[GMSCameraPosition cameraWithLatitude:activePOI.coordinate.latitude
longitude:activePOI.coordinate.longitude
zoom:DEFAULT_ZOOM
bearing:0. //True north
viewingAngle:0.]; //Facing down
[self.mapView animateToCameraPosition:newPosition];
I've tried using GMSCoordinateBounds to display both POI and user locations, with this code:
GMSCoordinateBounds *cb =
[[GMSCoordinateBounds alloc] initWithCoordinate:activePOI.coordinate
coordinate:user.coordinate];
[GMSCameraUpdate fitBounds:cb];
It works pretty well, but both locations are displayed at the corners of the map.
I need to display the POI at the centre, but at the same time display the user location.
Any idea on how to achieve this?
Cheers.