使用MapKit进行定位的时候出现的错误
错误代码:
ERROR /BuildRoot/Library/Caches/com.apple.xbs/Sources/VectorKit_Sim/VectorKit-1230.34.9.30.27/GeoGL/GeoGL/GLCoreContext.cpp 1763: InfoLog SolidRibbonShader:
ERROR /BuildRoot/Library/Caches/com.apple.xbs/Sources/VectorKit_Sim/VectorKit-1230.34.9.30.27/GeoGL/GeoGL/GLCoreContext.cpp 1764: WARNING: Output of vertex shader 'v_gradient' not read by fragment shader
错误:
1.定位海上而非当前位置。
2.无法缩放地图区域显示大小。
不知为什么这里有张图片上传总是操作失败。
错误1
参考教程:
https://www.youtube.com/watch...
教程下方的评论:
结果:尝试过依旧定位海上、有错误提示。
自己搜索引擎查询的链接:
https://codedump.io/share/8I0...
结果由于自己之前定位在海上而非白屏,而且自己手机为iOS11不支持所以暂无法测试。
随后自己输入Ccustom Location,
根据Google地图,再次运行即为当前位置。(这里以望京SOHO为例)
错误2:
无法缩放地图大小。
代码:
let manager = CLLocationManager()//创建manager跟踪用户位置
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation])
//方法的作用:存储所有数据包括用户的位置:location
{
//提取用户的位置,创建变量“位置”,设置等于0,//该数组的第一元素,最近一段时间在变量的位置:location
let location = locations[0]
//对地图区域进行放大:span
let span:MKCoordinateSpan = MKCoordinateSpanMake(0.1, 0.1)
//创建用户位置或存储用户位置变量:mylocation //位置坐标点的纬度与经度
let myLocation:CLLocationCoordinate2D = CLLocationCoordinate2DMake(location.coordinate.latitude,location.coordinate.longitude)
//结合跨度和区域变量的位置并设置地图区域:region
let region:MKCoordinateRegion = MKCoordinateRegionMake(myLocation,span)
mapview.setRegion(region,animated:true)
self.mapview.showsUserLocation = true//显示蓝点
}
请问错误代码和定位海上以及无法缩放地图大小是什么原因?谢谢
若我的代码注释有误也请帮忙指出,谢谢