Ios 在GMSMapView sdk中是否有显示当前位置的默认按钮

Ios 在GMSMapView sdk中是否有显示当前位置的默认按钮,ios,google-maps,Ios,Google Maps,我正在添加自定义按钮并添加操作 CLLocationCoordinate2D target=CLLocationCoordinate2DMake(currentLocation.coordinate.latitude,currentLocation.coordinate.longitude); [mapView_ animateToLocation:target]; 用于将地图移动到当前位置。sdk中是否有默认按钮?是有默认按钮显示地图的当前位置。只有在API中设置myLocati

我正在添加自定义按钮并添加操作

CLLocationCoordinate2D target=CLLocationCoordinate2DMake(currentLocation.coordinate.latitude,currentLocation.coordinate.longitude);
     [mapView_ animateToLocation:target]; 

用于将地图移动到当前位置。sdk中是否有默认按钮?

是有默认按钮显示地图的当前位置。只有在API中设置
myLocationEnable
时,它才可见

从文件中

默认情况下,地图上不显示位置数据。通过在GMSMapView上设置myLocationEnabled,可以启用蓝色“我的位置”点和指南针方向

启用此功能还将通过myLocation属性提供用户的当前位置。此属性可能不会立即可用-例如,如果iOS提示用户允许访问此数据。在这种情况下是零


可能还需要执行以下操作:mapView.settings.myLocationButton=true
mapView_.myLocationEnabled = YES;
NSLog(@"User's location: %@", mapView_.myLocation);