ios - 缩小后折线开始消失
问题描述
我遇到了一个奇怪的问题,当我缩小自定义坐标的折线开始消失时,以下是我的代码
func setTrackerLines(currentLoc: String, destinationLoc: String) {
let str1 = currentLoc
let LocArray1 = str1.components(separatedBy: ",")
let str2 = destinationLoc
let LocArray2 = str2.components(separatedBy: ",")
let path = GMSMutablePath()
path.add(CLLocationCoordinate2D(latitude: (LocArray1[0] as NSString).doubleValue, longitude: (LocArray1[1] as NSString).doubleValue))
path.add(CLLocationCoordinate2D(latitude: (LocArray2[0] as NSString).doubleValue, longitude: (LocArray2[1] as NSString).doubleValue))
let rectangle = GMSPolyline(path: path)
rectangle.strokeColor = UIColor.blue
rectangle.strokeWidth = 1
rectangle.map = self.myMapView
}
}
在 viewdidload() 上调用了这个方法,这就是我使用代码的方式
for i in 0 ..< pointArray.count {
print("Delta: \(delta)")
if pointArray.count != (i + 1) {
self.setTrackerLines(currentLoc: pointArray[i], destinationLoc: pointArray[i + 1])
}
结果显示在图片中。请帮忙
解决方案
推荐阅读
- backup - 恢复centos“/”分区回来的问题
- sql - 交叉连接表以查看一个表中的哪些合作伙伴有另一个表中的报告
- python - 在测试和训练数据集中使用基于时间的拆分来拆分数据
- python - 在辅助监视器中打开 Python CEF 应用程序
- python - 如何解释和调查不平衡数据中的完美准确度、精确度、召回率、F1 和 AUC(我不信任)
- elasticsearch - 用于缓存和搜索产品的弹性搜索?
- angular - ng build --prod 时使用 ngx-hm-carousel 模块出错
- c# - Sitefinity 404 多语言页面
- ios - Obj-C NSMutableArray 返回 nil
- python - GridSearchCV.best_score 与 cross_val_score 不同(GridSearchCV.best_estimator_)