Fusion Table - Zoom to Boundaries of Region

2019-06-14 14:43发布

问题:

I am creating a multiregion and district map which you can see here: http://vciregionmap.com/new/

It used this Fusion Table in the new version: https://www.google.com/fusiontables/DataSource?snapid=S587803AEqk

It works great, the only thing it does not do and used to do in the old version - the code is in there but stopped working about 8 months ago.

I need the legend to is zoom to the bounds of the region and district that you choose.

I am unsure of how to get the map to zoom upon clicking the legend - I think I may be able to do without drawing the bounds of regions and districts, but the zoom (as you see) is really needed.

Here is what I am having issues with . . Map View 1 - Show all 5 Regions with outline on bounds of Region. Map View 2- Zoom into Region and show bounds for each district. Map View 3 - Zoom into District bounds showing only markers for that district.

回答1:

Your query is only "selecting" one column (Latitude), but the callback routine expects 2:

      parseFloat(response.getDataTable().getValue(i, 0)),
      parseFloat(response.getDataTable().getValue(i, 1)));

That is why you get this javascript error:

Uncaught Error: Invalid column index 1. Should be an integer in the range [0-0]. 

This thread in the fusion tables users group from 6 months ago explains the problem and includes the fix (this post).

I think this is what you are trying to do