简体   繁体   English

无法在Google地球中渲染kml文件

[英]Unable to render kml file in google earth

I am getting big transparent white box with a red border and red X as output when I try to render below kml file in Google Earth. 当我尝试渲染Google Earth中的kml文件时,我正在获得带有红色边框和红色X作为输出的大透明白框。 Could anyone please let me know why it is not rendering properly. 任何人都可以让我知道为什么它没有正确呈现。

kml file link : https://www.wpc.ncep.noaa.gov/kml/winwx/HPC_Day1-3_psnow_gt_08_nlbody.kml kml文件链接: https//www.wpc.ncep.noaa.gov/kml/winwx/HPC_Day1-3_psnow_gt_08_nlbody.kml

If you're trying to view this in the new Google Earth (v9) on web, then you're likely hitting CORS issues. 如果您尝试在网络上的新Google地球(v9)中查看此内容,那么您可能会遇到CORS问题。

The link provided the comments is working for me when viewed in Earth Pro (v7), where it loads a screen overlay with a legend, a few small data polygons in the Rocky Mountains, and a giant ground-overlay image with white text on it over the middle of the USA. 链接提供了评论在Earth Pro(v7)中查看时,我在其中加载带有图例的屏幕叠加层,落基山脉中的一些小数据多边形,以及带有白色文本的巨型地面叠加图像在美国中部。

On Google Earth for web, it gives me the red X that you're describing. 在Google Earth for web上,它为我提供了您正在描述的红色X. If you look at the Chrome developer console, you'll see that the images requested by that KML file come from a server that does not have the necessary CORS (Cross Origin Request) headers set on the outgoing files (screenshot below). 如果您查看Chrome开发人员控制台,您会看到该KML文件请求的图像来自服务器,该服务器没有在传出文件上设置必要的CORS(交叉源请求)标头(下面的屏幕截图)。 The red X is just what Earth shows when it can't get or load an image. 红色X正是地球在无法获取或加载图像时所显示的内容。 Unfortunately Earth on web has additional security requirements, and all files requested by the app must have CORS enabled. 遗憾的是,网络上的地球有其他安全要求,应用程序请求的所有文件都必须启用CORS。 Unless you know someone at NOAA who can update the server to provide the necessary CORS headers, you'll have to stick with Earth Pro to view this one. 除非你认识NOAA的某个人可以更新服务器以提供必要的CORS标题,否则你必须坚持使用Earth Pro来查看这个标题。

您在地球上为Web加载的KML的屏幕截图,在控制台中出现CORS错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM