谷歌地图融合层忽略WHERE子句

Google Maps Fusion Layer ignores WHERE clause

本文关键字:WHERE 子句 融合 谷歌地图      更新时间:2023-09-26

我在使融合表层中的where子句实际执行任何操作时遇到问题。

下面应该做的是从我的融合表中选择"收入"超过100的所有行(或者对于特定的geom(MSOA),如果你在where子句中交换代码)。

融合表列average_income是Number类型,MSOA11CD是Text类型。

这里有一个关于同一主题的老问题,但通过我没有的语法错误解决了。"其中";Google Maps 中Fusion表层中被忽略的子句

Fiddle here:http://jsfiddle.net/dqthnw7s/

layer = new google.maps.FusionTablesLayer({
    map: map,
    heatmap: {
        enabled: false
    },
    query: {
        select: "*",
        from: "1QEMdQUSmsdEZs9vAchHeKPG_CsKa7L0zW0SBJSCu",
        where: "average_income > 100",
        //tried this too
        //where: 'MSOA11CD = ''E02004590'''
    },
    styles: [{
       where: "average_income > 1000",
        polygonOptions: {
            fillColor: '#002951'
        }
    }, {
        where: "average_income > 800 AND average_income <= 1000",
        polygonOptions: {
            fillColor: '#003466'
        }
    }, {
        where: 'average_income > 100 AND average_income <= 800',
        polygonOptions: {
            fillColor: '#376798'
        }
    }]
});

融合表:https://www.google.com/fusiontables/DataSource?docid=1QEMdQUSmsdEZs9vAchHeKPG_CsKa7L0zW0SBJSCu#rows:id=1

如有任何帮助,我们将不胜感激!

select"*"无效。这需要一个"几何"列。

layer = new google.maps.FusionTablesLayer({
    map: map,
    heatmap: {
        enabled: false
    },
    query: {
        select: "geometry",
        from: "1QEMdQUSmsdEZs9vAchHeKPG_CsKa7L0zW0SBJSCu",
        where: "average_income > 100",
        //tried this too
        //where: 'MSOA_CODE = ''E02004590'''
    },
    styles: [{
       where: "average_income > 1000",
        polygonOptions: {
            fillColor: '#002951'
        }
    }, {
        where: "average_income > 800 AND average_income <= 1000",
        polygonOptions: {
            fillColor: '#003466'
        }
    }, {
        where: 'average_income > 100 AND average_income <= 800',
        polygonOptions: {
            fillColor: '#376798'
        }
    }]
});

更新的fiddle