多个 KML 和 414 错误:请求 URI 太大
我有大量的 KML 文件 - 每个现有国家/地区都有一个。我需要根据用户的输入在 Google 地图上动态呈现它们。如果搜索结果只有几个国家/地区,则一切正常 - 地图显示所有国家/地区。当有超过 15 个国家做突出显示时就会出现问题。几乎所有 KML 请求都会出现 414 错误。
据我所知,Google 地图分为图块,对于每个图块,都会处理一个 KML 请求。如果需要为图块生成太多 KML 文件,则此类请求的 URL 太长(414 错误)。
你知道我该如何克服这个问题吗?
以下是此类请求的示例:
http://mt0.googleapis.com/mapslt?hl=pl&lyrs=kml%3AcuwPC5SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq3izLNIeOTEA1oE|kv%3A3|api%3A3%2Ckml%3AcuwPC5SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq1ixq5IeOTEA1oE|kv%3A3|api%3A3%2Ckml%3AcuwPC5SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq3iz7ZIeOTEA1oE|kv%3A3|api%3A3%2Ckml%3AcuwPC5SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq1iy61IeOTEA1oE|kv%3A3|api%3A3%2Ckml%3AcuwPC5SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq2CfZHwyIkHtAg|kv%3A3|api%3A3%2Ckml%3AcuwPC5SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq3iw6xIeOTEA1oE|kv%3A3|api%3A3%2Ckml%3AcuwPC5SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq2aCOyKhEdOPKBF|kv%3A3|api%3A3%2Ckml%3AcuwPC5SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq1ix7BIeOTEA1oE|kv%3A3|api%3A3%2Ckml%3AcuwPC5SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq2aCAyLhEdOPKBF|kv%3A3|api%3A3%2Ckml%3AcuwPC5SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq1iy7lIeOTEA1oE|kv%3A3|api%3A3%2Ckml%3Acu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SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq2aANyKhEdOPKBF|kv%3A3|api%3A3&x=1&y=1&z=1&w=256&h=256&source=maps_api&token=104074
感谢您的帮助
I've got plenty of KML files - one for each of the existing countries. I need to render them dynamically on Google Map based on user's input. If I there are only a few countries as result of searching, everything works perfectly - the map displays all the countries. The problem occurs when there are more than about 15 countries do highlight. I get 414 errors for almost all KML requests.
As far as I know, Google Map is divided on tiles and for each of the tiles, one KML request is proceeded. If there's too many KML files that need generated for a tile, then URL for such a request is too long (414 error).
Do you have any idea how can I overcome this problem?
Here is an example of such a request:
http://mt0.googleapis.com/mapslt?hl=pl&lyrs=kml%3AcuwPC5SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq3izLNIeOTEA1oE|kv%3A3|api%3A3%2Ckml%3AcuwPC5SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq1ixq5IeOTEA1oE|kv%3A3|api%3A3%2Ckml%3AcuwPC5SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq3iz7ZIeOTEA1oE|kv%3A3|api%3A3%2Ckml%3AcuwPC5SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq1iy61IeOTEA1oE|kv%3A3|api%3A3%2Ckml%3AcuwPC5SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq2CfZHwyIkHtAg|kv%3A3|api%3A3%2Ckml%3AcuwPC5SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq3iw6xIeOTEA1oE|kv%3A3|api%3A3%2Ckml%3AcuwPC5SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq2aCOyKhEdOPKBF|kv%3A3|api%3A3%2Ckml%3AcuwPC5SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq1ix7BIeOTEA1oE|kv%3A3|api%3A3%2Ckml%3AcuwPC5SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq2aCAyLhEdOPKBF|kv%3A3|api%3A3%2Ckml%3AcuwPC5SCy4YxYqf-KUu31-kH0-ba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mIlHaxq2aCMyLhEdOPKBF|kv%3A3|api%3A3%2Ckml%3AcuwPC5SCy4YxYqf-KUu31-kH0-baWhlLmIlHaxq2aANyKhEdOPKBF|kv%3A3|api%3A3&x=1&y=1&z=1&w=256&h=256&source=maps_api&token=104074
Thanks for your help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你是否必须将它们放在单独的kml文件中你可以只用多个文件夹输出你的xml吗并且在每个文件夹中每个区域只是一个想法让我知道它是否是垃圾
do you have to have them in separate kml files can you just output your xml with multiple folders and within each folder is each area just an idea let me know if its rubbish