Seresco Maps Utils iOS
描述
这是一个使用 Google Maps Api 的 iOS 地图工具库
- 追踪
- KML
- 聚类
- 标记
使用方法
例如,显示追踪面板
import SerescoMapsUtils
let trackingUtils = TrackingUtils()
func openTrackingPanel() {
trackingUtils.currentViewController = self
trackingUtils.openTrackingPanel()
}
func showTrackedRoute() {
trackingUtils.showSavedCoordinates(googleMap: self.mapView)
}
例如,使用 KML、标记和聚类工具
import SerescoMapsUtils
let kmlUtils = KMLUtils()
let markerUtils = MarkerUtils()
// import kml map data
func importKmlData() {
let layer = kmlUtils.retrieveKml(map: mapView, pathResource: "name_of_kml_resource", strokeColor: UIColor.black, fillColor: UIColor.gray, strokeWidth: 2)
layerSpain.render()
}
// show KML Settings Panel
func openKmlSettingsPanel() {
let vc = KmlSheetViewController()
present(vc, animated: true, completion: nil)
}
// import Markers and Cluster data
func showPlacesLocations() {
markerUtils.retrieveMarkers(map: self.mapView, resource: "name_of_cluster_resource", icon: "name_of_icon")
}
安装
CocoaPods
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '12.0'
use_frameworks!
target 'MyApp' do
pod 'SerescoMapsUtils', '~> 0.0.1'
end