gpt4 book ai didi

ios - GMSMapView 显示整个世界地图?

转载 作者:行者123 更新时间:2023-11-29 10:24:49 24 4
gpt4 key购买 nike

我正在添加我的 map View

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

在我的应用程序中,此 View 仅用于显示整个世界地图和一些标记。我无法在一个 View 中显示整个世界。任何帮助都将不胜感激,我不希望用户在上面进行交互

最佳答案

我也遇到过这个问题

- (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]];
}

请试试这个并分享响应。

快乐编码:)

关于ios - GMSMapView 显示整个世界地图?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32884983/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com