iOS GMaps委托mapView:markerInfoWindow:未实现

Ant*_*ton 1 google-maps objective-c ios

我正在尝试为标记创建自定义信息窗口.我正在使用Google Maps SDK for iOS.

我已经创建了包含所有对象的自定义XIB文件.为它创建了类.

GMSMapViewDelegate在Header文件中调用

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

- (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;
}
Run Code Online (Sandbox Code Playgroud)

但仍有默认标记.可能是什么问题?

感谢帮助.

Lal*_*lji 7

如果不添加GMSMapView Delegate,请尝试

您在实现文件中添加GMSMapView Delegate

GMSMapView * mapView_ = [GMSMapView mapWithFrame:viewmapbaseView.bounds camera:camera];
mapView_.delegate=self;
Run Code Online (Sandbox Code Playgroud)