Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WKInterfaceMap does not Load Map

I am building an Apple Watch App, with should place a pin in a map position, I am using the Xcode simulator, but the map just does not load...

enter image description here

Here is my sample code, there is some other kind of settings that I am missing?

import WatchKit
import MapKit

class MapController: WKInterfaceController {

    @IBOutlet var map: WKInterfaceMap!

    override func awakeWithContext(context: AnyObject?) {
        super.awakeWithContext(context)

        let centerOfMap = CLLocationCoordinate2D(latitude: -3.743205, longitude: -38.514871)
        let pinPosition = CLLocationCoordinate2D(latitude: -3.65, longitude: -38.514871)
        let coordinateSpan = MKCoordinateSpanMake(1, 1)

        self.map.addAnnotation(pinPosition, withPinColor: .Red)
        self.map.setRegion(MKCoordinateRegion(center: centerOfMap, span: coordinateSpan))
    }
}
like image 456
Ulysses Avatar asked Nov 09 '22 18:11

Ulysses


1 Answers

It does not load map tiles for simulator. You'll have to test it on the actual watch.

like image 190
UrosMi Avatar answered Nov 14 '22 23:11

UrosMi