Created
December 31, 2015 17:26
-
-
Save felipegenuino/8b0ab112a17e69f9623c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// mapa | |
// | |
// Created by Felipe Genuino on 31/12/15. | |
// Copyright © 2015 Felipe Genuino. All rights reserved. | |
// | |
import UIKit | |
import MapKit | |
class ViewController: UIViewController, MKMapViewDelegate { | |
@IBOutlet var mainMap: MKMapView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let latitude:CLLocationDegrees = -27.5993134 | |
let longitude:CLLocationDegrees = -48.6138322 | |
let latDelta:CLLocationDegrees = 0.01 | |
let lonDelta:CLLocationDegrees = 0.01 | |
let span:MKCoordinateSpan = MKCoordinateSpanMake(latDelta, lonDelta) | |
let location:CLLocationCoordinate2D = CLLocationCoordinate2DMake(latitude, longitude) | |
let region:MKCoordinateRegion = MKCoordinateRegionMake(location, span) | |
mainMap.setRegion(region, animated: true) | |
} | |
override func didReceiveMemoryWarning() { | |
super.didReceiveMemoryWarning() | |
// Dispose of any resources that can be recreated. | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment