在浏览器中显示的谷歌地图上叠加 KML 文件时出现问题
我们正在将一些 KML 文件叠加到浏览器中显示的 Google 地图上。 KML 文件显示在普通 Google 地图上时可以按预期工作。但是,当在浏览器中显示的谷歌地图中显示时,KML 文件不会按预期显示。 KML 文件是通过使用在线转换器工具转换 Shape 文件来生成的。
我们使用原始形状文件并从美国人口普查局网站检索县信息。
需要帮助解决问题。
We are in the process of overlaying some KML files on Google Map displayed in Browser. The KML files when displayed on the normal Google Maps works as expected. But, when displayed in the google Map displayed in the browser the KML files are not getting displayed as expected. The KML files are generated by converting the Shape files using an online converter tool.
We used the original shape files and retrieved county information from US Census Bureau Site.
Need Help in resolving the issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您提供了正在使用的代码或 .kml 文件,这将会很有帮助,这样我就可以看到哪里出了问题。
不管怎样,你可以像这样向你的地图添加一个kml:
It would be helpful if you've provided the code that you're using, or the .kml file, so I can see where it goes wrong.
Anyway, you can add a kml to your map like this:
您如何创建 KmlLayer?
传递到 KmlLayer 构造函数中的 URL 必须是可公开访问的 URL,以便 Google 的服务器可以检索 KML/KMZ,然后将其呈现在返回给您的图块上。
如 Google 地图 v3 API 参考中所示:
请记住,KML 和 KMZ 文件也存在限制。有关这方面的信息,请访问:http://code.google.com/apis /kml/documentation/mapsSupport.html
How are you creating your KmlLayer?
The URL passed into the constructor of the KmlLayer must be a publicly accessible one so that Google's server can retrieve the KML/KMZ then render it on the tile which it returns to you.
As seen in Google Maps v3 API Reference:
Keep in mind there are also limits imposed on the KML and KMZ files. Information on this can be found here: http://code.google.com/apis/kml/documentation/mapsSupport.html