1
votes

I have created a series of fusion table layers and apply filtering to one of the layers in response to checkbox click events. The base layer of the map contains a gradient applied over county boundaries. When the base layer is unchecked, the filtered layer loses it's styling. I have added unique timestamps to all queries to avoid caching, however I get the feeling that these image tiles are still be cached for this situation. Is there any way to force the google fusion tables api to invalidate a cached image?

Test site here: http://map.inquestmarketing.com/new.html

Unchecking the Other -> Consumer Prospects checkbox reproduces the issue.

This is a pure client app, all of the source is in the single page.

Update

I was able to workaround this by applying style filters to the FusionTablesLayer client side.

I filtered for 3 different cases, but in order to apply the styles across the board I could have used:

styles: [{ markerOptions: { iconName: "large_blue" } }]

in the FusionTablesLayer constructor and the setOptions function.

Hope this helps someone else!

3

3 Answers

0
votes

I don't think there are anyways to prevent cache the tile data. Because Fusion Table renders the tile images on Google server, and which takes a few moments in generally.

Also most browser caches the images based on the URLs generated by FusionTableLayer(that means Javascript).

0
votes

The issue is a coding problem on your map; you hide this layer based on that (Consumer Prospects) check box. If you want it to be displayed don't hide it and leave it hidden. I don't see offhand why the blue markers go with it.

0
votes

As per Kathryn at Google you can refresh the tiles by adding a time stamp. Here's a jQuery snippet you can use or adapt for your needs.

setTimeout(function(){
       $("img[src*='googleapis']").each(function(){
               $(this).attr("src",$(this).attr("src")+"&"+(new Date()).getTime());
       });
},3000);

Source: https://groups.google.com/forum/#!msg/fusion-tables-users-group/wCLHnyoZRYk/MtLHFZ-o4zAJ