Skip to content

Instantly share code, notes, and snippets.

@smellman
Created September 19, 2015 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smellman/b4fb12a186ed13345b63 to your computer and use it in GitHub Desktop.
Save smellman/b4fb12a186ed13345b63 to your computer and use it in GitHub Desktop.
ViewController.swift for gsimap with mapbox-gl-native
//
// ViewController.swift
// mapboxsdktest
//
// Created by 松澤 太郎 on 2015/09/20.
// Copyright © 2015年 Taro Matsuzawa. All rights reserved.
//
import UIKit
import Mapbox
class ViewController: UIViewController, MGLMapViewDelegate {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let styleURL = NSURL(string: "https://gist.githubusercontent.com/smellman/494dbd3868ca6a8f3b41/raw/91a7ca5467315d0346e452de103302fa73cf9661/json")
let mapView = MGLMapView(frame: view.bounds,
styleURL: styleURL)
mapView.autoresizingMask = [.FlexibleWidth, .FlexibleHeight]
view.addSubview(mapView)
}
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