简体   繁体   中英

Leverage MapKit to render custom image - iOS

Our use case is to display an image to the user which she can maximize/minimize (pinch). Also, there are specific points (Options) on the image which user can click. In case user decides to maximize the image then the points will also increase in size in proportion.

I have been exploring MapKit. Well, MapKit is extremely convenient to use because it provides all these functionalities - I can identify the touch and I don't have to worry about the user pinching the image.

I am wondering if it is possible to paste an image (probably the image of a human body) over this mapView without showing the map! Its like a quiz - where the user needs to click on the head.

Code to display the map:

import Foundation
import UIKit
import MapKit
@objc public class MTMapViewController : MTAbstractQuizController {

    @IBOutlet weak var mapView: MKMapView!

    public override func viewDidLoad() {
        super.viewDidLoad()
    }

    public override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
    }
}

I am just exploring if mapView can be used to resolve my use case.

With the introduction of iOS11 , MKMapType will have a new case, called mutedStandard , which will be A street map where your data is emphasized over the underlying map details. See the official documentation .

I haven't tried this myself, but it seems like a suitable candidate for your problem.

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