3
我試圖將融合表層數據放在我的Google Map
上,但出現錯誤Request-URI太大。我搜索了很多,但無法找到如何通過POST方法或其他方式使其工作。問題是where clause
,但我無法縮短where子句。有沒有人可以幫助我或引導我?Request-URI太大(Fusion表層Google地圖)
在此先感謝您的幫助。
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](http://en.wikipedia.org/wiki/FIPS_county_code)或其他定義的號碼? – geocodezip
針對此問題的解決方案可能是基於上述查詢創建視圖。然後你只需要查詢視圖。 – davidkonrad
該查詢是動態的,因此我無法基於任何查詢創建視圖。 –