Skip to content

Commit

Permalink
Added map to Apple Watch, changing the JSON File
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-headspace committed Nov 25, 2018
1 parent 6917f87 commit 86e49fb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Musgravite/Controller/DetailViewController.swift"
timestampString = "564862025.403434"
timestampString = "564864561.821962"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "195"
Expand Down Expand Up @@ -42,7 +42,7 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Musgravite/Controller/DetailViewController.swift"
timestampString = "564862025.403586"
timestampString = "564864561.822165"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "196"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import WatchKit
import Foundation


public extension WKInterfaceImage {

public func setImageWithUrl(url:String, scale: CGFloat = 1.0) -> WKInterfaceImage? {
Expand All @@ -35,6 +36,9 @@ class DetailInterfaceController: WKInterfaceController {
@IBOutlet weak var bigImageOutlet: WKInterfaceImage!
@IBOutlet weak var labLocationOutlet: WKInterfaceLabel!
@IBOutlet weak var floorLocationOutlet: WKInterfaceLabel!
@IBOutlet weak var mapOutlet: WKInterfaceMap!
let locationManager = CLLocationManager()


override func awake(withContext context: Any?) {
if let receivedLab = context as? LabData {
Expand All @@ -46,7 +50,11 @@ class DetailInterfaceController: WKInterfaceController {
bigtitleOutlet.setText(lab.nombre)
labLocationOutlet.setText(lab.ubicacion)
floorLocationOutlet.setText("Piso \(lab.piso)")
bigImageOutlet.setImageWithUrl(url: lab.posterImage)
/* Map */
let tec=CLLocationCoordinate2D(latitude: 19.283996, longitude: -99.136006)
let region=MKCoordinateRegion(center:tec, span: MKCoordinateSpan(latitudeDelta: 0.005, longitudeDelta: 0.005))
mapOutlet.setRegion(region)
mapOutlet.addAnnotation(tec, with: .purple)
}

@IBAction func onMenuBackTap() {
Expand Down
1 change: 1 addition & 0 deletions WMusgravite/Base.lproj/Interface.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
<outlet property="bigtitleOutlet" destination="esy-fm-pgN" id="i6A-Ep-8Cq"/>
<outlet property="floorLocationOutlet" destination="Kob-N1-tGk" id="KoY-ey-zxb"/>
<outlet property="labLocationOutlet" destination="qct-tH-dKB" id="NiO-du-74r"/>
<outlet property="mapOutlet" destination="KEn-Ho-QIj" id="WIZ-HM-hG0"/>
</connections>
</controller>
</objects>
Expand Down

0 comments on commit 86e49fb

Please sign in to comment.