Skip to content

Instantly share code, notes, and snippets.

@rockarts
Created September 3, 2018 05:26
Show Gist options
  • Select an option

  • Save rockarts/9a00cd32c86bc736a7a9aa045d426b67 to your computer and use it in GitHub Desktop.

Select an option

Save rockarts/9a00cd32c86bc736a7a9aa045d426b67 to your computer and use it in GitHub Desktop.
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),
"Deltaform":(51.301585, -116.245475),
"Neptuak": (51.307604, -116.257772),
"Wenkchemna Peak": (51.328359, -116.275496)
]
if let terrainNode = terrainNode {
for location in locations {
let markerHeight = CGFloat(50.0)
let text = SCNText(string: location.key, extrusionDepth: 1)
let material = SCNMaterial()
material.diffuse.contents = UIColor.red
text.materials = [material]
let sphereMarker = SCNNode(geometry: text)
sphereMarker.geometry?.firstMaterial?.diffuse.contents = UIColor.red
let tempLocation = CLLocation(latitude: location.value.0, longitude: location.value.1)
sphereMarker.position = terrainNode.positionForLocation(tempLocation)
sphereMarker.position.y += Float(markerHeight / 2.0) + 200
sphereMarker.scale = SCNVector3(x: 11, y: 11, z: 11)
terrainNode.addChildNode(sphereMarker)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment