【问题标题】:Google Maps Fusiontable query where clause shows "data may still be loading"Google Maps Fusiontable 查询 where 子句显示“数据可能仍在加载”
【发布时间】:2023-03-22 18:07:01
【问题描述】:

我正在尝试过滤融合表中的一些数据,然后显示结果图形。

代码是:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>map</title>
</head>
<body>
<div id="map-canvas" style="height:500px"></div>

<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script>
    function initialize() {
        var sloCenter = new google.maps.LatLng(46.119944, 14.815333);

        var map = new google.maps.Map(document.getElementById('map-canvas'), { zoom: 8, center: sloCenter });

        var layerLUO = new google.maps.FusionTablesLayer({
            query: {
                select: 'graphics',
                from: '1bcKOFVL1kfjLOHGTXibbKzGN-4_Xvy_mj73iteY',
                where: "LUO_ID = 51" //if you comment this line it works. LUO_ID is Number type and 51 is a valid data for this column
            },
            options: {
                styleId: 2
            },
            map: map
        });
    }

    google.maps.event.addDomListener(window, 'load', initialize);
</script>
</body>
</html>

您可以在以下位置查看表格:https://www.google.com/fusiontables/DataSource?docid=1bcKOFVL1kfjLOHGTXibbKzGN-4_Xvy_mj73iteY

过滤器在 fusiontable GUI 中工作。

谁能解释一下问题出在哪里?

【问题讨论】:

    标签: google-maps google-fusion-tables


    【解决方案1】:

    根据我的经验,“数据可能仍在加载”意味着查询有问题。

    在我看来,您的 LUO_ID 列的名称开头有一个“特殊”字符(如果我将鼠标悬停在该 ID 上,我会在“L”之前看到一个“框”。那个框似乎是 @987654321 @)。如果我使用 col0 代替它可以工作(即URL you get if you click on "publish"):

    example using "col0"

    example using LUO_ID

    【讨论】:

    • 非常感谢。我自己找不到。现在可以了。
    • 您导入表中的数据看起来有问题。您的表格不允许下载,因此我无法测试该理论,但“发布”功能使用的 col0 确实有效。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-06-11
    • 1970-01-01
    • 2011-03-18
    • 1970-01-01
    • 1970-01-01
    • 2014-01-01
    • 1970-01-01
    相关资源
    最近更新 更多