【发布时间】:2013-10-11 07:43:25
【问题描述】:
我正在尝试将融合表层数据放在我的 Google Map 上,但我收到一个错误 Request-URI Too Large。我进行了很多搜索,但找不到如何通过 POST 方法或其他方法使其工作。问题是 where clause 但我不能缩短 where 子句。有没有人可以帮助或指导我?
提前感谢您的帮助。
layer = new google.maps.FusionTablesLayer({
map: googleMap,
heatmap: {enabled: false},
query: {
select: "col4",
from: "tableID",
where: "",
},
styles: [{
polygonOptions: {
fillOpacity: 0.3
}
}, {
where: "col0 in ('Jefferson','Pulaski','Los Angeles','Denver','Middlesex','New Castle','Duval','Pinellas','Lee','Broward','Fulton','Cobb','Ada','Tazewell','Cook','Marion','Hendricks','Putnam','Adams','Boone','Orleans','Plymouth','Baltimore','Washington','Macomb','Genesee','Oakland','Hennepin','Jackson','Shelby','Granite','Forsyth','Mecklenburg','Wake','Douglas','Gloucester','Passaic','Bernalillo','Sandoval','Clark','New York','Montgomery','Hamilton','Tulsa','Oklahoma','Multnomah','Lane','Chester','Philadelphia','York','Lehigh','Kent','Horry','Davidson','Travis','Harris','Dallas','Fairfax','Chesterfield','King','Brown','Laramie','Kalamazoo','Cabarrus','San Diego','Pennington','Richland','Weber','Ramsey','Hartford') AND col3 in ('AL','AR','CA','CO','CT','DC','DE','FL','GA','ID','IL','IN','WV','OH','KY','LA','MA','MD','MI','MN','MO','TN','MT','NC','NE','NJ','NM','NV','NY','OK','OR','PA','RI','SC','TX','VA','VT','WA','WI','WY','SD')",
polygonOptions: {
fillColor: '#ffffff',
strokeColor: '#ff0000',
fillOpacity: 0.3
}
}],
options: {
styleId: 1,
templateId: 2
}
});
【问题讨论】:
-
为什么说不能缩短 where 子句?您不能添加具有 2 或 3 个字符/数字唯一代码的新列并替换 col0(县?)吗?或者使用FIPS 或其他定义的号码?
-
解决方案可能是基于上述查询创建一个视图。然后你只需要查询视图。
-
该查询是动态的,因此我无法根据任何查询创建视图。
-
@geocodezip 我已经为每个县尝试了 2 位唯一代码,但是当县的查询增加时,它也会产生相同的 Request-URI Too Large 问题。
标签: javascript jquery google-maps-api-3 google-fusion-tables