0

I am using FusionTableLayer at http://www.zimmi.cz/slepaMapa/ with click listener. Each time feature is clicked, the feature's color is set (green - right, red - wrong). Everything works fine, but at some point (after about 40 to 50 clicks), the whole map becomes unclickable. If you zoom out, features turn clickable again, but after several clicks (not more than 3, i guess), it switches again. I don't think there is anything in the code that could be causing it (although i'd be glad if anyone can have a look). Is there any limit regarding the number of click events per map or per minute? I didn't find any neither in GM JS API, nor in Fusion API. Tested on Windows XP SP3 with latest versions of Opera and Firefox.

Michal Zimmermann
  • 646
  • 1
  • 7
  • 23

1 Answers1

0

This is because of URL length restrictions (~2KB). See this SO Q&A thread for detail on othis restriction.

Community
  • 1
  • 1
Chris Broadfoot
  • 5,082
  • 1
  • 29
  • 37
  • As I understood from the link, the URL length is not a priori set in any a browser. How comes that after zooming the map out click event works again? If the URL length is really a problem (I assume the where clause might be just too long), how do i get rid of it? I was thinking of adding a column called CLICKED to a table and changing its value once the feature is clicked, but that would be really slow I think. – Michal Zimmermann Feb 13 '12 at 08:56
  • Yeah, that is a weird part. I can't explain it. – Chris Broadfoot Feb 14 '12 at 05:58
  • Well i did several test and found out the length of 'where' clause was the problem. The easiest way to solve the problem is to use some ID column instead of strings (e. g. '1' is much much shorter than 'Mississippi') :-). Anyway, it doesn't solve the problem for really long 'where' clauses, but in my case it works. – Michal Zimmermann Feb 14 '12 at 12:15