Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // ViewController.swift
- // Playground
- //
- // Created by Rahul Dhodapkar on 11/1/14.
- // Copyright (c) 2014 Rahul Dhodapkar. All rights reserved.
- //
- import UIKit
- class ViewController: UIViewController, GMSMapViewDelegate {
- var gmaps: GMSMapView?
- override func viewDidLoad() {
- super.viewDidLoad()
- var target: CLLocationCoordinate2D = CLLocationCoordinate2D(latitude: 51.6, longitude: 17.2)
- var camera: GMSCameraPosition = GMSCameraPosition(target: target, zoom: 6, bearing: 0, viewingAngle: 0)
- gmaps = GMSMapView(frame: CGRectMake(0, 0, self.view.bounds.width, self.view.bounds.height))
- if let map = gmaps? {
- map.myLocationEnabled = true
- map.camera = camera
- map.delegate = self
- if let gmapsUnwrapped = gmaps {
- self.view.addSubview(gmapsUnwrapped)
- }
- }
- }
- override func didReceiveMemoryWarning() {
- super.didReceiveMemoryWarning()
- // Dispose of any resources that can be recreated.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement