Question

So I have a FusionTablesLayer with multiple location columns all set to a KML value. You can check the coordinates by selecting "preview KML" after double clicking on the row. I composed an image to show the various columns of the intended result (to scale).

Multiple Location Columns

The first column Islands is depicted in red, West in green, and East in blue. Trying to work with this in a JSFiddle is not working at all. Each layer, when switched to, uses the same column. The expected outcome is to show the single green marker to the West when clicking on West, and the single blue marker to the East when clicking on East. Note that these are 3 distinct location columns I'm using on 3 disjoint FusionTableLayers displaying separately.

According to the Google Maps API #FusionTablesQuery, I should be able to select whichever column I want to use as the Location. Is it a bug, or am I misreading the docs?

Was it helpful?

Solution

You have an extra set of quotes around your strings in your queries (make "'Islands'" -> "Islands").

    layers = [new google.maps.FusionTablesLayer({
        query: {
            select: "Islands", //Location KML with a Polygon and a single Point inside it
            from: table
        },
        styles: styles[0],
        map: map
    }), new google.maps.FusionTablesLayer({
        query: {
            select: "West",  //Location KML that is a single Point to the West of Islands Polygon
            from: table
        },
        styles: styles[1]
    }), new google.maps.FusionTablesLayer({
        query: {
            select: "East",  //Location KML that is a single Point to the East of Islands Polygon
            from: table
        },
        styles: styles[2]

working fiddle

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top