ios - 应用程序启动时在谷歌地图标记上打开信息窗口

标签 ios objective-c google-maps google-maps-sdk-ios

我是 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/

相关文章:

ios - 超过最大触摸次数使得程序不调用touchesEnded方法?

IOS,为什么有些开发人员在模拟中创建带下划线的变量(_variable)

ios - 自动布局 : frame is 600x480 in compact/Any size class, 的 ScrollView 大小大于 iphone5?

ios - 为无尽的跑酷游戏创建动态大小的 SKSpriteNode 平台

ios - 旋转呈现 View 并锁定呈现 View Controller 的方向

Android 6.0 应用程序崩溃,谷歌地图上出现错误 null

android - iOS应用程序开发是否有与Android类似的最低/目标SDK版本

objective-c - 是否可以在 Windows 中执行 Objective-C 程序?

google-maps - 如何模拟 'google_maps_flutter' 包进行 flutter 测试?

javascript - Google map - 如何使标记成为在灯箱中打开的链接