How to display multiple KML files on one map

家住魔仙堡 提交于 2019-12-01 12:51:58
geocodezip

You can display one in each KmlLayer, but you can't control them other than to hide/show them.

There is a limitation, at some point the internal URL request (which includes all of the individual KmlLayer urls) exceeds a limit, and none of them display. Described in the documentation:

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 display. The limit is based on the total length of all URLs passed to the KMLLayer class, and consequently will vary by application; on average, you should be able to load between 10 and 20 layers without hitting the limit.

You could import your KML into FusionTables, display it in a FusionTablesLayer and control the styling and display via the Google Maps Javascript API v3 (again there are limitations, but seems more likely to work that one hundred KmlLayers)

My answer to this question: Highlight country around the border from your search area only contains an example with two different styles, one for the center (blue border) and one for the surrounding counties (red).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!