问题描述
mapBox ios sdk 版本 6.2.1
您好,我正在尝试在 mapBox 上显示矢量切片图层,但我无法让它显示在正确的位置。
我像这样添加火层:
let source = MGLVectorTileSource(identifier: "VIirs_NOAA20_Thermal_Anomalies_375m_All",tileURLTemplates: ["https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/VIirs_NOAA20_Thermal_Anomalies_375m_All/default/2021-03-02/500m/{z}/{y}/{x}.mvt"],options: nil)
style.addSource(source)
let layer = MGLCircleStyleLayer(identifier: "VIirs_NOAA20_Thermal_Anomalies_375m_All_v2_NRT",source: source)
layer.sourceLayerIdentifier = "VIirs_NOAA20_Thermal_Anomalies_375m_All_v2_NRT"
layer.circleRadius = NSExpression(forConstantValue: 2)
layer.circleColor = NSExpression(forConstantValue: UIColor.red)
style.addLayer(layer)
知道出了什么问题吗?谢谢
编辑:似乎问题在于 MapBox 使用 epsg:3857 投影,但来自服务器的矢量切片使用 epsg:4326 投影。有什么方法可以在客户端转换它吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)