414 Request URI Too Large Error Google Maps v3

邮差的信 提交于 2019-12-24 04:07:27

问题


This error seems to occur when I call the constructor for creating a new KmlLayer with over 15 different KMZ files. The constructor call is:

var layer = new google.maps.KmlLayer('http...');

I can replicate this error every time with 15 different KMZ files. I have tried reducing sizes of the files, but it doesn't seem to matter. Once you go for the 16th request to display a polygon from the KMZ, all the requests will fail stating 414 Request URI Too Large. Once this error happens, none of the polygons will show unless you go back to 15 or under.

I tried to render all 15 KMZ files into a single KMZ, then display that, but now my requests amount has gone from roughly 100 to about 350...

Does anyone have a work around for this?


回答1:


414 Request URI Too Large means that the URL you are using (e.g., http://www.example.com/kmlFile.kml?option1=true&option2=false) is too long, not that the file is too big. You'll need to shorten the URL somehow.



来源:https://stackoverflow.com/questions/5489042/414-request-uri-too-large-error-google-maps-v3

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