Skip to content

Instantly share code, notes, and snippets.

@felipegenuino
Created December 31, 2015 17:26
Show Gist options
  • Save felipegenuino/8b0ab112a17e69f9623c to your computer and use it in GitHub Desktop.
Save felipegenuino/8b0ab112a17e69f9623c to your computer and use it in GitHub Desktop.
//
// 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