Custom annotation view in Google Maps SDK

前端 未结 2 1590
谎友^
谎友^ 2020-11-30 09:32

I created an iOS application based on maps in which I thought to use Google Maps SDK for iOS instead of Mapkit, I found the documentation but it I didn’t find methods relate

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-30 10:01

    If you check GMSMapView.h within GoogleMaps.Framework, you can see the below method which should let you add a custom infowindow for a marker, instead of using standard title and snippet alone:

    NOTE you (op) say annotationView=infoWindow
    BUT NORMAL: annotationView = marker itself and calloutView = infoWindow

    /**
     * Called when a marker is about to become selected, and provides an optional
     * custom info window to use for that marker if this method returns a UIView.
     * If you change this view after this method is called, those changes will not
     * necessarily be reflected in the rendered version.
     *
     * The returned UIView must not have bounds greater than 500 points on either
     * dimension.  As there is only one info window shown at any time, the returned
     * view may be reused between other info windows.
     *
     * @return The custom info window for the specified marker, or nil for default
     */
    - (UIView *)mapView:(GMSMapView *)mapView
        markerInfoWindow:(id)marker;
    

提交回复
热议问题