javascript - Google Maps API KML 图层限制

标签 javascript google-maps-api-3 kml

我需要根据特定条件在 Google Maps API map 上显示大量 KML 文件。

当我尝试添加这些 KML 文件时,我最终遇到了 Google map 和 KML 图层的一些限制。

enter image description here

我试过使用缩短的 URL、PHP 脚本、缩短的 URL 和 PHP 脚本,但似乎没有任何东西可以解决问题,我仍然在几秒钟内达到极限...

最佳答案

来自documentation :

Number of KML layers

There is a limit on the number of KML Layers that can be displayed on a single Google Map. If you exceed this limit, none of your layers will appear on the map, and an error will be reported in your web browser's JavaScript console. The limit is based on a combination of the number of KMLLayer classes created and the total length of all the URLs used to create those layers. Each new KMLLayer you create will take up a portion of the limit for the layer and a further portion of the limit depending on the length of the URL where the KML file was loaded from. Consequently, the number of layers you can add will vary by application; on average, you should be able to load between 10 and 20 layers without hitting the limit. If you still hit the limit, use a URL shortner (such as https://goo.gl) to shorten the KML URLs. Alternatively, create a single KML file consisting of NetworkLinks to the individual KML URLs.

关于javascript - Google Maps API KML 图层限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45386187/

相关文章:

javascript - 如何使用jquery从数组中删除未选中的项目

javascript - 过滤 Backbone 集合时内存泄漏

javascript - 如何在 jquery 中创建叠加形状

javascript - 如何在当前 maptype google maps api V3 上获得高对比度绘图的最佳笔触颜色

javascript - 谷歌地图信息窗口在不同标记上给出相同的结果

api - 使用 kml 文件时,Google map 缩放被覆盖

javascript - 带有本地存储的下拉 CSS

javascript - 在 Javascript 中从谷歌地图读取地标信息

javascript - 在 Google 地球企业客户端中以编程方式打开气球

css - Google Maps API V3 Z-index 不工作