I'm developing an JSP application that retrieves a lot of polygons to show on the map.
I will try explain how the application works before tell my problem.
My client needs to check on Google Maps his internal division of territories (a territory is a set of cities, it's a many-to-many association). The territory-city relationship can be changed anytime by loading a file via an application menu. Today we have 35 territories and about 10000 associations territory-city in the system.
I have the polygons with the shape of the cities in Fusion Tables, but when I try to retrieve the shapes, I get the following error:
Code to load the polygons for one territory:
layer = new google.maps.FusionTablesLayer({
query:{
select: 'geometry',
from: {MYKEY},
where: "NAME_CITY IN ("+listOfCities+")"
}
});
Error:
Failed to load resource: the server responded with a status of 414 (Request-URI Too Large)
I'm looking for a way to load these territories from a long time, I already tried to read the KML files from Java, and send the set of coordinates for each city, but the HTML page was like 300MB when done, and it just froze the browser and didn't work. So the Fusion Tables seemed to be the best approach.
I found out a few posts where people were telling to use the POST method to request the data, because of the size of the listOfCities variable(some territories have about 500 cities associated), but they never said how to do it using the Google Maps API.
How can I do that? Anybody have another approach to solve this problem?
Thanks