gpt4 book ai didi

ios - 如何在 ios 应用程序中的谷歌地图上添加多个引脚

转载 作者:行者123 更新时间:2023-12-01 18:15:44 24 4
gpt4 key购买 nike

我有在谷歌地图上添加单针的代码。而这项工作完全。
但是当我添加第二个引脚时,它会覆盖第一个引脚。
这是我在 map 上添加单个引脚的代码。

GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:latitude1 longitude:longitude1 zoom:18];

mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
mapView_.myLocationEnabled = YES;

self.view = mapView_;
GMSMarker *marker = [[GMSMarker alloc] init];
marker.position = CLLocationCoordinate2DMake(latitude1, longitude1);
marker.title = @"Ahmedabad";
marker.snippet = @"India";
marker.map = mapView_;
marker.icon = [UIImage imageNamed:@"m1.png"];

最佳答案

self.view = mapView_;     
for(int i=0;i<[array count];i++)
{
GMSMarker *marker = [[GMSMarker alloc] init];
marker.animated=YES;
marker.position = CLLocationCoordinate2DMake(latitude,longitude);
marker.title = @"name";
marker.snippet = @"snippet";
marker.map = mapView_;
}

这对我有用。

关于ios - 如何在 ios 应用程序中的谷歌地图上添加多个引脚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22169670/

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