The following javascript code is not working which has a query to google fusion table.
$('#map_canvas').gmap({ 'center': new google.maps.LatLng(37.447038,-122.160575), 'zoom': 11, 'mapTypeId' : google.maps.MapTypeId.ROADMAP, 'callback': function(map) {
$('#map_canvas').gmap('loadFusion', { 'query': {
'from': '297050' ,
'orderBy': ST_DISTANCE('Address', LATLNG(37.447038,-122.160575)),
'limit':10 } });
var t = setTimeout(function() {$('#dialog').dialog('close');}, 2000);
}
});
If I remove the query line having the orderby clause (as below) it works fine
$('#map_canvas').gmap({ 'center': new google.maps.LatLng(37.447038,-122.160575), 'zoom': 11, 'mapTypeId' : google.maps.MapTypeId.ROADMAP, 'callback': function(map) {
$('#map_canvas').gmap('loadFusion', { 'query': {
'from': '297050' ,
'limit':10 } });
var t = setTimeout(function() {$('#dialog').dialog('close');}, 2000);
}
});
Please Advise hot to fix this query
The “orderBy” property seems to work as a string. Instead of:
Try (notice the double quotes (“) around the orderBy property:
Working example