gpt4 book ai didi

ios - 无法在iOS版Google Maps的GMSMapView上移动相机

转载 作者:行者123 更新时间:2023-12-01 17:09:16 24 4
gpt4 key购买 nike

我创建了一个GMSMapVIew对象,如代码所示。不幸的是,相机未设置在正确的坐标上:

GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:latitude
longitude:longitude
zoom:15];



mapView_ = [[GMSMapView alloc] initWithFrame:CGRectMake(505, 280, 427, 200)];
mapView_.camera = camera;
mapView_.myLocationEnabled = YES;

UIViewController *mapController = [[UIViewController alloc] initWithNibName:nil bundle:nil];
mapController.view = mapView_;

[self addChildViewController:mapController];
[self.view addSubview:mapView_];

我还尝试过使用以下代码重新定位摄像头,但也没有成功:
CLLocationCoordinate2D current = CLLocationCoordinate2DMake(latitude,longitude);
GMSCameraUpdate *currentCam = [GMSCameraUpdate setTarget:current];
[mapView_ animateWithCameraUpdate:currentCam];

有人有想法吗,我在做什么错,还是这个简单的iOS版Google Maps中的错误?

最佳答案

您是否使用相同的

    CLLocationCoordinate2D current = CLLocationCoordinate2DMake(latitude,longitude);

GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:latitude
longitude:longitude
zoom:15];

纬度和经度?显然,它不会起作用,因为没有任何变化...

关于ios - 无法在iOS版Google Maps的GMSMapView上移动相机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18226732/

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