Fusion table layer: data may be still loading
On hitting fusion table layer on Maps, it says data may be still loading
Answer: Check your query syntex, new query syntex is as given below with an example
(Non numeric fields must be enclosed with '' quotes)
function fetchDataFromFusionTable(){
try{
var fusionOptions = {
query: {
select: 'Geometry',
//from: "1QTnVfSO-agR4ueOAVa-uUzYrmNwE4DQ6l0e22EA",
from: "1Fhnl0uOC3Ol3rMHI5FQIiTDIP3gw7QbRjldvFgY",
where: " 'Start_Date' >= '"+startDate+"' AND 'End_Date' <= '"+endDate+"' " +
" AND 'DMA_Code' >0 " //'Start_Date >= '+startDate+' 00:00:00'
},
styles: [{
where: 'Available_Impressions > 0 AND Available_Impressions <= 1000',
polygonOptions: {
fillColor: '#ffffff',
fillOpacity: 0.4
}
}, {
where: 'Available_Impressions > 1000 AND Available_Impressions <=100000',
polygonOptions: {
fillColor: '#88bad8',
fillOpacity: 0.4
}
}, {
where: 'Available_Impressions > 100000 AND Available_Impressions <=1000000',
polygonOptions: {
fillColor: '#5792c3',
fillOpacity: 0.4
}
}, {
where: 'Available_Impressions > 1000000',
polygonOptions: {
fillColor: '#4572ab',
fillOpacity: 0.4
}
}]
}
layer.setOptions(fusionOptions);
}catch(err){
alert(err);
}
}
Answer: Check your query syntex, new query syntex is as given below with an example
(Non numeric fields must be enclosed with '' quotes)
function fetchDataFromFusionTable(){
try{
var fusionOptions = {
query: {
select: 'Geometry',
//from: "1QTnVfSO-agR4ueOAVa-uUzYrmNwE4DQ6l0e22EA",
from: "1Fhnl0uOC3Ol3rMHI5FQIiTDIP3gw7QbRjldvFgY",
where: " 'Start_Date' >= '"+startDate+"' AND 'End_Date' <= '"+endDate+"' " +
" AND 'DMA_Code' >0 " //'Start_Date >= '+startDate+' 00:00:00'
},
styles: [{
where: 'Available_Impressions > 0 AND Available_Impressions <= 1000',
polygonOptions: {
fillColor: '#ffffff',
fillOpacity: 0.4
}
}, {
where: 'Available_Impressions > 1000 AND Available_Impressions <=100000',
polygonOptions: {
fillColor: '#88bad8',
fillOpacity: 0.4
}
}, {
where: 'Available_Impressions > 100000 AND Available_Impressions <=1000000',
polygonOptions: {
fillColor: '#5792c3',
fillOpacity: 0.4
}
}, {
where: 'Available_Impressions > 1000000',
polygonOptions: {
fillColor: '#4572ab',
fillOpacity: 0.4
}
}]
}
layer.setOptions(fusionOptions);
}catch(err){
alert(err);
}
}
Comments
Post a Comment