2017-01-25 27 views
0

我在我的应用程序中使用了Google Maps API。我做了标记是这样的:谷歌地图pin链接到视图控制器

//Marker 
    let marker = GMSMarker() 
    marker.position = CLLocationCoordinate2DMake(54.317160, 10.134287) 
    marker.title = "Restaurant" 
    marker.snippet = "Clickable Button" 
    marker.map = mapview 

我想插入可点击按钮或文字链接我有不同的看法控制器。我搜索了很多东西以找到解决方案,但没有找到任何适合我的东西。 我能做什么?

回答

0

Google Map委托方法。 创建新的UIViewController因为这将是标志你的信息窗口和下面的方法存在于酥料饼

-(BOOL)mapView:(GMSMapView *)mapView didTapMarker:(GMSMarker *)marker 

你的新的ViewController

创建的UIButton的行动,或者您也可以使用以下方法敲击信息标记窗口。

- (void)mapView:(GMSMapView *)mapView didTapInfoWindowOfMarker:(GMSMarker *)marker 
+0

我该如何在swift 3中做到这一点? – luki512