Image with image zoom or map view option

1

I am developing an application where I need to insert a map of an internal location (as soon as the map view of apple is not registered), I would like to know if it has a mapView mount (mounting the internal location) an ImgView and allow zooming, since I have the plant in jpg? Thanks

Current code:

class MapasViewController: UIViewController, UIScrollViewDelegate {

@IBOutlet weak var imgMapa: UIImageView! // *** Declara imgView
@IBOutlet weak var scrollView: UIScrollView!
func viewForZoomingInScrollView(scrollView: UIScrollView) -> UIView? {
    return imgMapa
}

override func viewDidLoad() {
    super.viewDidLoad()
    print("*** LOG : TELA DE MAPAS CARREGADA ***")


    let width: CGFloat = imgMapa.image!.size.width
    let height: CGFloat = imgMapa.image!.size.height

    scrollView.minimumZoomScale = 1.0
    scrollView.maximumZoomScale = 6.0
    scrollView.contentSize = CGSizeMake(width, height)
    scrollView.delegate = self
    scrollView.zoomScale = 1.0

}




}
    
asked by anonymous 04.10.2015 / 02:34

1 answer

1

My answer goes to the second option, because I do not know if you can do it with MKMapKit .

What you basically need to do is put UIImageView into UIScrollView . If you are using the interface builder and auto layout , add the following elements:

04.10.2015 / 14:52