English 中文(简体)
在Fusion Tables地图显示中直接比较两列值
原标题:Directly comparing two column values in Fusion Tables map display

我有一个未列出的Fusion表,其中包含威斯康星州的选举数据和投票计数样本,我正在为选举之夜构建一个地图显示页面。我想根据哪个候选人的投票数更高来有条件地设置县多边形的样式,但我似乎无法基于直接比较列值的WHERE子句进行任何样式设置。相反,默认样式生效,where子句从不生效。

我对FT”SQL-ish“语法让我觉得它不允许直接比较两列的WHERE子句,所以也许这就是阻止我的原因……但是,天哪,我非常想这样做。我缺少什么技术吗?

候选人1的投票计数在“1_Vote_Count”中,候选人2的投票计数则在“2_Vote_Coount”中。

    <script type="text/javascript">
     function initialize () {
        var map = new google.maps.Map(document.getElementById( map-canvas ), {
          center: new google.maps.LatLng(44.824708,-89.780273),
          zoom: 7,
          mapTypeId: google.maps.MapTypeId.ROADMAP,
          streetViewControl: false,
          mapTypeControl: false,
          zoomControl: true,
          zoomControlOptions: {
                style: google.maps.ZoomControlStyle.SMALL
          },
          panControl: false,
        });

        var layer = new google.maps.FusionTablesLayer({
          query: {
            select:  geometry ,
            from:  173CovMDpzEwyBBtF2fwkxHB5nt6zETzBzG-3YLE ,
            where: "Office_ID =  G  AND FIPS_Code > 0"
          },
        styles: [{
            polygonOptions: {
              fillColor: "#00FF00",
              fillOpacity: 0.3,
              strokeWeight: 0.5
            }
          }, {
            where: " 1_Vote_Count  <  2_Vote_Count ",
            polygonOptions: {
              fillColor: "#DD0000"
            }
          }, {
            where: " 2_Vote_Count  <  1_Vote_Count ",
            polygonOptions: {
              fillColor: "#0000DD"
            }
          }]
        });

layer.setMap(map);

}
</script>
最佳回答

你不缺任何技巧。我建议打开一个功能请求,正如Eric所指出的那样。

http://code.google.com/p/fusion-tables/issues/list?q=Type%3DFeature_Request一

问题回答

暂无回答




相关问题
Trouble with Get request from Google Fusion tables

I ve been having trouble querying the Google Fusion Tables using an HTTP request. If I paste the URL from the query below in the browser, it comes back with a commas separated list. However, when I do ...

How to port a PostgreSQl database to Google App engine

i am currently doing a project as one of my university projects and it uses Google maps and right now i am using a postgresql database which is on my localhost but i want to host it some where else i ...

3. 将与谷歌汇表相结合

我最近试图将一个以javascript形式开发的视像化项目移至WT,希望获得更好的结构和优化的代码。 作为转让的一部分,我们还想从东角走......。

jqGrid returns blank cells

Can t seem to get the following jqGrid code to work http://cablegate.politicswiki.ie/stackoverflow.html <script type="text/javascript"> $(document).ready(function(){ jQuery("#list2")....

JqGrid with Google Fusion Tables

Trying to get jqGrid to work with Google fusion tables. Can t seem to find the event in jqGrid that allows you to control where it gets data from. Would accept an equivalent javascript table engine ...

Building on top of Google Fusion Tables

How do you modify and build on top of Google Fusion Tables? I want customize the way that people can upload data, the way the data appears on the maps, and the results that search queries return. I ...

热门标签