How to show a Info window in iOS Google maps without tapping on Marker?

前端 未结 8 585
故里飘歌
故里飘歌 2020-12-05 07:14

I am new to iOS development. This is regarding Marker info window in Google Maps iOS SDK.

I understand, we can create a marker with info window using GMSMarkerOption

8条回答
  •  天命终不由人
    2020-12-05 07:46

    This has changed on Google Maps SDK and it's easier to understand:

    GMSMarker *marker = [[GMSMarker alloc] init];
    marker.position = coordinate;
    marker.title = @"Location selected";
    marker.snippet = @"Testing";
    marker.map = mapView_;
    
    //Show info window on map
    [mapView_ setSelectedMarker:marker];
    

    You use now setSelectedMarker method to show an info window of a marker

提交回复
热议问题