This file contains hidden or 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
| var step = 20; | |
| for(var x = 0; x < size; x += step) { | |
| for(var y = 0; y < size; y+= step) { | |
| draw(x, y, step, step); | |
| } | |
| } |
This file contains hidden or 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
| func drawLine(x:Int, y:Int, width:Int, height:Int) { | |
| let leftToRight:Bool = Bool.random() | |
| let path = UIBezierPath() | |
| if(leftToRight) { | |
| path.move(to: CGPoint(x: x, y: y)) | |
| path.addLine(to: CGPoint(x: x + width, y: y + height)) | |
| } else { | |
| path.move(to: CGPoint(x: x + width, y: y)) |
This file contains hidden or 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
| class DrawView: UIView { | |
| override init(frame: CGRect) { | |
| super.init(frame: frame) | |
| } | |
| required init?(coder aDecoder: NSCoder) { | |
| fatalError("init(coder:) has not been implemented") | |
| } | |
| override func draw( _ rect: CGRect) { |
This file contains hidden or 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
| class ViewController: UIViewController { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| let draw = DrawView(frame: self.view.bounds) | |
| view.addSubview(draw) | |
| } | |
| } | |
| class DrawView: UIView { | |
| override init(frame: CGRect) { |
This file contains hidden or 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
| //create terrain geometry based on mapbox elevation data | |
| terrainNode.fetchTerrainHeights(minWallHeight: 100.0, enableDynamicShadows: true, progress: { progress, total in }, completion: { | |
| NSLog("Terrain load complete") | |
| //ADD THE POINTS OF INTEREST CALL HERE! | |
| self.addValleyofTheTenPeaksPOIMarkers() | |
| }) |
This file contains hidden or 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
| func addValleyofTheTenPeaksPOIMarkers() { | |
| let locations : [String: (CLLocationDegrees, CLLocationDegrees)] = [ | |
| "Moraine Lake": (51.320143, -116.185173), | |
| "Mt. Fay": (51.298343, -116.163270), | |
| "Mt Little": (51.295878, -116.183472), | |
| "Mt Bowlen": (51.299772, -116.188203), | |
| "Mt Tonsa": (51.296674, -116.201430), | |
| "Mt Perren": (51.296779, -116.208143), | |
| "Mt Allen": (51.291698, -116.219711), | |
| "Mt Tuzo": (51.301836, -116.227780), |
This file contains hidden or 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
| //Valley of the 10 Peaks | |
| //NE & SW Corners | |
| var minLat = 51.20 | |
| var minLon = -116.28 | |
| var maxLat = 51.32 | |
| var maxLon = -116.12 | |
| var terrainNode: TerrainNode? | |
| var terrainNodeScale = SCNVector3(0.0003, 0.0003, 0.0003) // Scale down map (otherwise it's far too big) |
This file contains hidden or 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
| import UIKit | |
| import Mapbox | |
| import SceneKit | |
| import MapKit | |
| import MapboxSceneKit | |
| class ViewController: UIViewController { | |
| var sceneView: SCNView = SCNView() |
This file contains hidden or 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
| source 'https://github.com/CocoaPods/Specs.git' | |
| project 'ExploreOutdoors.xcodeproj' | |
| platform :ios, '11' | |
| workspace 'ExploreOutdoors' | |
| use_frameworks! | |
| target 'ExploreOutdoors' do | |
| pod 'Mapbox-iOS-SDK' |
This file contains hidden or 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 | |
| // ExploreOutdoors | |
| // | |
| // Created by Steven Rockarts on 2018-09-01. | |
| // Copyright © 2018 Figure4Software. All rights reserved. | |
| // | |
| import UIKit | |
| import Mapbox |