Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inventhq/dot-globe
Dotted Globe for Swift!
https://github.com/inventhq/dot-globe
Last synced: about 2 months ago
JSON representation
Dotted Globe for Swift!
- Host: GitHub
- URL: https://github.com/inventhq/dot-globe
- Owner: inventhq
- License: mit
- Created: 2023-05-24T23:06:46.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-22T10:36:25.000Z (over 1 year ago)
- Last Synced: 2024-08-03T18:12:55.674Z (5 months ago)
- Language: Swift
- Size: 227 KB
- Stars: 95
- Watchers: 3
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-swiftui-libraries - DotGlobe - A Library to that draws a dotted earth map to a globe and allows you to interract with it (Map / Content)
README
![image (4)](https://github.com/inventhq/dot-globe/assets/69051988/44fd8847-66ea-43ca-84dd-1865a6ddb53b)
# dot-globeA SceneKit and Metal Powered interactive globe for UIKit and SwiftUI
## Features- Display an interactive 3D globe
- Customize the appearance of the globe, including earth color, glow color, and reflection color etc.
- Control the radius of the earth and size of the dots on the globe.
- Enable/disable particle effects, such as stars.
- Works with SwiftUI.
- Works with iOS, MacOS, iPadOS, and even with WatchOS!## TODOs:
- Add animation and interaction with the globe -- Working on
- Add country grouping and add necessary methods to SwiftUI and UIKit# Showroom
https://github.com/inventhq/dot-globe/assets/69051988/63a86a5a-8994-4b4d-ae23-8aba5ec9777a# Usage
## UIKit
```swift
import UIKit
import DotGlobeclass ViewController: UIViewController {
override func viewDidLoad() {
// initialize controller here
let globeController = GlobeViewController()
globeController.earthColor = UIColor(red: 0.0, green: 0.482, blue: 0.871, alpha: 1.0)
globeController.glowColor = UIColor(red: 0.0, green: 0.22, blue: 0.482, alpha: 1.0)
globeController.reflectionColor = UIColor(red: 0.0, green: 0.482, blue: 0.871, alpha: 1.0)
present(globeController, animated: true, completion: nil)
}
}
```
![Screenshot 2023-05-25 at 14 50 06](https://github.com/inventhq/dot-globe/assets/69051988/0477fd22-13d2-4a0c-84f1-7ff3295f1722)Customization:
- dotCount: Amounts of dots used to draw the earth map, adjust it for your needs
- earthRadius: Adjusts the radius of the earth in the globe.
- dotSize: Sets the size of the dots displayed on the globe, by default, it is 0.005.
- enablesParticles: Enables or disables particle effects, by default, background is starry.
- particles: Sets the particle system for the globe's background.
- background
- earthNode: You can directly access to the earthNode to customize the earth itself
- earthColor: Sets the color of the earth on the globe.
- glowColor: Sets the color of the earth's glow effect.
- reflectionColor: Sets the color of the earth's reflection effect.
- glowShininess: Adjusts the shininess of the earth's glow effect.## SwiftUI
```swift
import SwiftUI
import DotGlobestruct ContentView: View {
var body: some View {
GlobeView()
}
}
```You can use all the parameters above to customize the globe. Because of the performance issues, you have to specify everything before dots and globe gets rendered, or dot cloud causes a massive rendering issue.