我是 iOS 开发新手,也是 iOS 版 Google map SDK 新手。
我目前正在开发 iPhone 应用程序,我想在应用程序启动时打开 Google map 标记的信息窗口。 (默认弹出信息窗口,不点击标记气球)。
有什么办法可以完成这个任务吗?
这是我的代码:
GMSMarker *marker = [[GMSMarker alloc] init];
marker.flat = YES;
marker.appearAnimation=YES;
marker.position = CLLocationCoordinate2DMake(lt,ln);
marker.title = name;
marker.snippet = type;
[self.mapView setSelectedMarker:marker];
marker.map = self.mapView;
最佳答案
如果您尝试在 didTapAtCoordonate
中创建标记,您应该在以下位置创建您的标记:
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
//create your marker here
}];
来自这里:infowindow not displaying with marker in didTapAtCoordinate method
关于ios - 应用程序启动时在谷歌地图标记上打开信息窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24449439/