iOS GMaps 委托 mapView:markerInfoWindow:未实现

iOS GMaps delegate mapView: markerInfoWindow: not implemented

我正在尝试为标记创建自定义信息 Window。我正在为 iOS.

使用 Google Maps SDK

我已经创建了包含所有对象的自定义 XIB 文件。为此创建了 class。

在头文件中调用了GMSMapViewDelegate

在实现文件中我实现了以下方法:

- (UIView *)mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker {

    NSLog(@"Implementing delegate Method");

    CustomInfoWindow *infoWindow =  [[[NSBundle mainBundle]
                                 loadNibNamed:@"InfoWindow"
                                        owner:self
                                      options:nil]
                                objectAtIndex:0];

    infoWindow.title.text = @"This is title";
    infoWindow.address.text = @"This is address";
    infoWindow.status.text = @"Here will be status";

    return infoWindow;
}

但是还是有默认标记。可能是什么问题?

感谢您的帮助。

不加GMSMapView Delegate试试

您在实现文件中添加 GMSMapView Delegate

GMSMapView * mapView_ = [GMSMapView mapWithFrame:viewmapbaseView.bounds camera:camera];
mapView_.delegate=self;