Google Maps Fusiontable query where clause shows “data may still be loading”

↘锁芯ラ 提交于 2019-12-13 05:18:25

问题


I'm trying to filter some data in fusion tables and then show the result graphics.

Code is:

<!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>

You can view the table at: https://www.google.com/fusiontables/DataSource?docid=1bcKOFVL1kfjLOHGTXibbKzGN-4_Xvy_mj73iteY

Filter works in the fusiontable GUI.

Can someone explain what the problem is?


回答1:


The "data may still be loading" in my experience means there is something wrong with the query.

Looks to me like your LUO_ID column has a "special" character at the beginning of the name (If I hover over that ID I see a "box" right before the "L". That box seems to be a UTF-8 Byte Order Mark). If I use col0 instead it works (which is the URL you get if you click on "publish"):

example using "col0"

example using LUO_ID



来源:https://stackoverflow.com/questions/20690522/google-maps-fusiontable-query-where-clause-shows-data-may-still-be-loading

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!