I am adding a custom button and adding the action
CLLocationCoordinate2D target=CLLocationCoordinate2DMake(currentLocation.coordinate.latitude,currentLocation.coordinate.longitude);
[mapView_ animateToLocation:target];
for moving the map to current location.Is there a default button in the sdk ?
Yes there is a default button to show current location of map. It will be only visible when you set myLocationEnable in the API.
From the documentation
Google Map SDK for iOS
By default, no location data is shown on the map. You may enable the blue "My Location" dot and compass direction by setting myLocationEnabled on GMSMapView.
mapView_.myLocationEnabled = YES;
Enabling this feature will also provide the user's current location through the myLocation property. This property may not be immediately available - for example, if the user is prompted by iOS to allow access to this data. It will be nil in this case.
NSLog(@"User's location: %@", mapView_.myLocation);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With