How to use Order by Query in Google Fusion Tables

847 Views Asked by At

How can I use a Order-By Query for a fusion table Layer.

var layer = new google.maps.FusionTablesLayer({
          query: {
            select: 'LATITUDE',
            from: '0ILwUgu7vj0VSZnVzaW9udGFibGVzOjEzNjcwNQ'
            //order-by : index,
            //group-by : group
          },
          map: map
        });
1

There are 1 best solutions below

0
On BEST ANSWER

See the documentation for FusionTablesQuery

Properties from | Type:string | The ID of the Fusion Tables table to display. This ID can be found in the table's URL, as the value of the dsrcid parameter. Required.

limit | Type:number | Limit on the number of results returned by the query.

offset | Type:number | Offset into the sorted results.

orderBy | Type:string | The method by which to sort the results. Accepts either of:

  • A column name. The column name may be suffixed with ASC or DESC (e.g. col2 DESC) to specify ascending or descending sort.
  • An ST_DISTANCE spatial relationship (sort by distance). A column and the coordinate from which to calculate distance must be passed, for example, orderBy: 'ST_DISTANCE(col1, LATLNG(1.2, 3.4))'.

select | Type:string | A column, containing geographic features to be displayed on the map. See Fusion Tables Setup in the Maps API documentation for information about valid columns.

where | Type:string | The SQL predicate to be applied to the layer.

There is no order-by or group-by. You may be able to include the "group" in the where clause.