2015-10-01 40 views
1

我加入我的地图视图像GMSMapView显示全世界地图?

mapView_ = [[GMSMapView alloc]initWithFrame:_viewMapContainer.bounds]; 
mapView_.myLocationEnabled = YES; 
mapView_.frame = _viewMapContainer.bounds; 
[_viewMapContainer addSubview: mapView_]; 

在我的应用程序这种观点只显示了世界和一些标记的全图。我无法显示一个view.Any帮助整个世界将是明显的,我不希望它

回答

2

我也面临这个问题

- (void)focusMapToShowAllMarkers 
{  
CLLocationCoordinate2D myLocation = ((GMSMarker *)_markers.firstObject).position; 
GMSCoordinateBounds *bounds = [[GMSCoordinateBounds alloc] initWithCoordinate:myLocation coordinate:myLocation]; 

for (GMSMarker *marker in _markers) 
    bounds = [bounds includingCoordinate:marker.position]; 

[_mapView animateWithCameraUpdate:[GMSCameraUpdate fitBounds:bounds withPadding:15.0f]]; 
} 

请试试这个和共享的用户交互响应。

快乐编码:)

+0

谢谢您的回复。以上代码用于显示可见区域中的所有标记。其实我想要的是在视图中显示完整的世界地图 – Jeff