How do I create an image overlay and add to MKMapView?

后端 未结 4 1374
甜味超标
甜味超标 2020-12-02 21:22

I am trying to learn MapKit and am now trying to add an image as an overlay to the map view. I can\'t seem to find any sample code to help explain how to do this.

Ca

4条回答
  •  無奈伤痛
    2020-12-02 22:02

    Documentation:

    • MKMapView functions to manage overlays allow for adding them to a map view.
    • MKOverlay is the protocol which your overlay object must conform to.
      • MKPolygon, MKPolyLine, MKCircle implement this protocol for simple shapes.
    • MKOverlayView is used to actually draw the overlay; subclasses exist for each of the above-mentioned simple shapes.

    Sample code:

    • HazardMap
    • KMLViewer

提交回复
热议问题