Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Examples/DemoARViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ final class DemoARViewController: UIViewController, ARSCNViewDelegate, ARSession
terrainNode.geometry?.materials = defaultMaterials()
arView!.scene.rootNode.addChildNode(terrainNode)
terrain = terrainNode
terrainNode.fetchTerrainAndTexture(minWallHeight: 50.0, enableDynamicShadows: true, textureStyle: "mapbox/satellite-v9", heightProgress: nil, heightCompletion: { fetchError in
terrainNode.fetchTerrainAndTexture(minWallHeight: 50.0, enableDynamicShadows: true, textureStyle: MapStyles.satellite.url, heightProgress: nil, heightCompletion: { fetchError in
if let fetchError = fetchError {
NSLog("Terrain load failed: \(fetchError.localizedDescription)")
} else {
Expand Down
2 changes: 1 addition & 1 deletion Examples/DemoHeightmapViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class DemoHeightmapViewController: UIViewController {
private weak var terrainNode: TerrainNode?
private var progressHandler: ProgressCompositor!

private let styles = ["mapbox/outdoors-v10", "mapbox/satellite-v9", "mapbox/navigation-preview-day-v2"]
private let styles = [MapStyles.outdoors.url, MapStyles.satellite.url, MapStyles.navigationPreviewDay.url]

required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
Expand Down
2 changes: 1 addition & 1 deletion Examples/DemoPlacementViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class DemoPlacementViewController: UIViewController {
let terrainFetcherHandler = progressHandler.registerForProgress()
let textureFetchHandler = progressHandler.registerForProgress()

terrainNode.fetchTerrainAndTexture(minWallHeight: 50.0, enableDynamicShadows: true, textureStyle: "mapbox/satellite-v9", heightProgress: { progress, total in
terrainNode.fetchTerrainAndTexture(minWallHeight: 50.0, enableDynamicShadows: true, textureStyle: MapStyles.satellite.url, heightProgress: { progress, total in
progressHandler.updateProgress(handlerID: terrainFetcherHandler, progress: progress, total: total)
}, heightCompletion: { fetchError in
if let fetchError = fetchError {
Expand Down
4 changes: 2 additions & 2 deletions Examples/DemoStyleViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class DemoStyleViewController: UIViewController {
@IBOutlet private weak var stylePicker: UISegmentedControl?
private weak var terrainNode: TerrainNode?

private let styles = ["mapbox/outdoors-v10", "mapbox/satellite-v9", "mapbox/navigation-preview-day-v2"]

private let styles = [MapStyles.outdoors.url, MapStyles.satellite.url, MapStyles.navigationPreviewDay.url]
override func viewDidLoad() {
super.viewDidLoad()

Expand Down
27 changes: 27 additions & 0 deletions Examples/MapStyles.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// MapStyles.swift
// Examples
//
// Created by Steven Rockarts on 2018-10-25.
// Copyright © 2018 MapBox. All rights reserved.
//

import Foundation

struct MapStyles {
public static let streets:DefaultStyle = DefaultStyle(url:"mapbox/streets-v10", name:"Streets", currentVersion:10)
static let outdoors:DefaultStyle = DefaultStyle(url:"mapbox/outdoors-v10", name:"Outdoors", currentVersion:10)
static let light:DefaultStyle = DefaultStyle(url:"mapbox/light-v9", name:"Light", currentVersion:9)
static let dark:DefaultStyle = DefaultStyle(url:"mapbox/dark-v9", name:"Dark", currentVersion: 9)
static let satellite:DefaultStyle = DefaultStyle(url:"mapbox/satellite-v9", name:"Satellite",currentVersion: 9)
static let satelliteStreets:DefaultStyle = DefaultStyle(url:"mapbox/satellite-streets-v10", name:"Satellite Streets", currentVersion:10)
static let navigationPreviewDay:DefaultStyle = DefaultStyle(url: "mapbox/navigation-preview-day-v2", name:"Navigation Preview Day", currentVersion: 2)

static let allStyles:[String] = [streets.url, outdoors.url, light.url, dark.url, satellite.url, satelliteStreets.url, navigationPreviewDay.url]

struct DefaultStyle {
let url:String
let name:String
let currentVersion:Int
}
}
4 changes: 4 additions & 0 deletions MapboxSceneKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
9598A005215EB4E80086CF4E /* StaticConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9598A003215EB4460086CF4E /* StaticConstants.swift */; };
959F81622149DE9700A290DF /* PolylineRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 959F81612149DE9700A290DF /* PolylineRenderer.swift */; };
95CC6AA4214ADB05000CD0E6 /* SCNExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95CC6AA3214ADB05000CD0E6 /* SCNExtensions.swift */; };
B0EACBFC218291060061CB26 /* MapStyles.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0EACBFB218291060061CB26 /* MapStyles.swift */; };
F44BB60520C75CBF00CE41C6 /* DemoExtrusionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F44BB60420C75CBF00CE41C6 /* DemoExtrusionViewController.m */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -106,6 +107,7 @@
9598A003215EB4460086CF4E /* StaticConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StaticConstants.swift; sourceTree = "<group>"; };
959F81612149DE9700A290DF /* PolylineRenderer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PolylineRenderer.swift; sourceTree = "<group>"; };
95CC6AA3214ADB05000CD0E6 /* SCNExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SCNExtensions.swift; sourceTree = "<group>"; };
B0EACBFB218291060061CB26 /* MapStyles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapStyles.swift; sourceTree = "<group>"; };
F44BB60220C75CBF00CE41C6 /* Examples-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Examples-Bridging-Header.h"; sourceTree = "<group>"; };
F44BB60320C75CBF00CE41C6 /* DemoExtrusionViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DemoExtrusionViewController.h; sourceTree = "<group>"; };
F44BB60420C75CBF00CE41C6 /* DemoExtrusionViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DemoExtrusionViewController.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -151,6 +153,7 @@
81293BCF20B4A1AE0014A17A /* Main.storyboard */,
81293BD420B4A1AE0014A17A /* Info.plist */,
F44BB60220C75CBF00CE41C6 /* Examples-Bridging-Header.h */,
B0EACBFB218291060061CB26 /* MapStyles.swift */,
);
path = Examples;
sourceTree = "<group>";
Expand Down Expand Up @@ -396,6 +399,7 @@
files = (
81293BF320B4A35C0014A17A /* DemoStyleViewController.swift in Sources */,
F44BB60520C75CBF00CE41C6 /* DemoExtrusionViewController.m in Sources */,
B0EACBFC218291060061CB26 /* MapStyles.swift in Sources */,
81293BF820B4A35C0014A17A /* TerrainDemoScene.swift in Sources */,
81293BF720B4A35C0014A17A /* ProgressCompositor.swift in Sources */,
8190075F20C07FAD002F23C3 /* AppDelegate.swift in Sources */,
Expand Down