简体   繁体   中英

iOS GMaps delegate mapView: markerInfoWindow: not implemented

I am trying to create custom Info Window for marker. I am using Google Maps SDK for iOS.

I have created custom XIB file with all objects. Created class for it.

Called GMSMapViewDelegate in Header file

in implementation file I implemented following method:

- (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;
}

But there is still default marker. What could be the issue?

Thanks for help.

Try if not add GMSMapView Delegate

You add GMSMapView Delegate in in implementation file

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM