Google 地图 API KML 图层限制
Google Maps API KML layer limit
我需要根据特定条件在 Google 地图 API 地图上显示大量 KML 文件。
当我尝试添加这些 KML 文件时,我最终遇到了 Google 地图和 KML 图层的一些限制。
我试过使用缩短的 URL、PHP 脚本、缩短的 URL 和 PHP 脚本,但似乎没有解决问题,我仍然在几秒钟内达到了极限...
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.
使用 GeoXML,我能够成功地将所有必需的 KML 添加到地图中!
https://github.com/geocodezip/geoxml3
感谢 Tony Miller 提供的解决方案!
我需要根据特定条件在 Google 地图 API 地图上显示大量 KML 文件。
当我尝试添加这些 KML 文件时,我最终遇到了 Google 地图和 KML 图层的一些限制。
我试过使用缩短的 URL、PHP 脚本、缩短的 URL 和 PHP 脚本,但似乎没有解决问题,我仍然在几秒钟内达到了极限...
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.
使用 GeoXML,我能够成功地将所有必需的 KML 添加到地图中! https://github.com/geocodezip/geoxml3
感谢 Tony Miller 提供的解决方案!