WorldMatrix
WorldMatrix
是一个用 Swift 4.2 编写的 iOS 库,允许你绘制带点的地图。
安装
CocoaPods
安装 WorldMatrix
最简单的方法是使用 CocoaPods。将以下依赖项添加到您的 Podfile
中,然后通过命令行运行 pod install
命令。
pod 'WorldMatrix', '~> 4.2.0'
用法
// worldArray can be generated with the generator (see `Generate a map)
var worldArray:Array<WorldCharacteristic> = []
let matrix = Matrix<WorldCharacteristic>(columns: 100, array: worldArray)
worldMatrixView.mapMatrix = matrix
生成地图
将生成器添加到您的 Podfile
pod 'WorldMatrix/Generator', '~> 4.2.0'
根据您想要的切割方式生成矩阵
let generator = WorldMatrixGenerator()
// Set the number of columns per rows (Default: 100)
generator.columns = 20
// Set your desired map cutting (Default: .world)
// use .custom(north, east, south, west) for a custom bounding
generator.mapCutting = .europe
// Set the output type (.enum, .ascii, .emoji) (Default: .enum)
generator.exportType = .enum
// Generates the world array
generator.generate()
演示
克隆此仓库。打开生成的 xcode 文件。在 iPhone 或 iPad 模拟器中运行相关构建方案以启动演示应用程序。
待办事项
- 处理逆向地理编码错误
许可证
查看 LICENSE 文件以了解许可权利和限制(MIT)。