在 Openlayers 中加载为 Google Earth 生成的 KML 图块
首先对我的英语感到抱歉,我在将 kml 文件(平铺)加载到 openlayers 中时遇到问题,该 kml 文件是使用此脚本为 google Earth 生成的 http://cimss.ssec.wisc.edu/imapp/dbge_v1.2.shtml,您可以在此处查看示例: http://modis.umag.cl/desarrollo/kml/2011.09.18.1742.2_3/2011.09.18.1742.2_3.kml,它在谷歌地球中加载正常,但我不知道如何在 openlayers 中做到这一点,我尝试过:
var layer = new OpenLayers.Layer.Vector("KML", {
projection: map.displayProjection,
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.HTTP({
url: "http://modis.umag.cl/desarrollo/kml/2011.09.18.1742.2_3/2011.09.18.1742.2_3.kml",
format: new OpenLayers.Format.KML({
extractStyles: true,
extractAttributes: true,
maxDepth: 4
})
})
})
但没有在地图中显示,有什么想法吗???谢谢。
first sorry for my english,i have a problem loading a kml file (tiled) into openlayers, the kml file is generated for google earth with this script http://cimss.ssec.wisc.edu/imapp/dbge_v1.2.shtml, you can see an example here: http://modis.umag.cl/desarrollo/kml/2011.09.18.1742.2_3/2011.09.18.1742.2_3.kml , it loads fine in google earth but i don't know how to do it in openlayers, i tried this:
var layer = new OpenLayers.Layer.Vector("KML", {
projection: map.displayProjection,
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.HTTP({
url: "http://modis.umag.cl/desarrollo/kml/2011.09.18.1742.2_3/2011.09.18.1742.2_3.kml",
format: new OpenLayers.Format.KML({
extractStyles: true,
extractAttributes: true,
maxDepth: 4
})
})
})
but is not showing in the map, any ideas??? thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将以下两行添加到您的代码中:
希望这对您有帮助。如果您遇到错误,请提及这些错误。它可以帮助我们解决。
Add the following two lines to your code:
Hope this helps you.If you are getting an error please mention those.It helps us to solve.