Advertisement
Guest User

Paste stuff

a guest
Nov 1st, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. //
  2. // ViewController.swift
  3. // Playground
  4. //
  5. // Created by Rahul Dhodapkar on 11/1/14.
  6. // Copyright (c) 2014 Rahul Dhodapkar. All rights reserved.
  7. //
  8.  
  9. import UIKit
  10.  
  11. class ViewController: UIViewController, GMSMapViewDelegate {
  12.  
  13. var gmaps: GMSMapView?
  14.  
  15. override func viewDidLoad() {
  16. super.viewDidLoad()
  17.  
  18. var target: CLLocationCoordinate2D = CLLocationCoordinate2D(latitude: 51.6, longitude: 17.2)
  19. var camera: GMSCameraPosition = GMSCameraPosition(target: target, zoom: 6, bearing: 0, viewingAngle: 0)
  20.  
  21. gmaps = GMSMapView(frame: CGRectMake(0, 0, self.view.bounds.width, self.view.bounds.height))
  22. if let map = gmaps? {
  23. map.myLocationEnabled = true
  24. map.camera = camera
  25. map.delegate = self
  26.  
  27. if let gmapsUnwrapped = gmaps {
  28. self.view.addSubview(gmapsUnwrapped)
  29. }
  30. }
  31. }
  32.  
  33. override func didReceiveMemoryWarning() {
  34. super.didReceiveMemoryWarning()
  35. // Dispose of any resources that can be recreated.
  36. }
  37.  
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement