Google Maps API - 来自同一个fusiontable的多个图层

时间:2013-02-28 21:24:41

标签: google-maps google-maps-api-3

是否可以在地图中从同一个融合表中加载许多不同的图层?我正在尝试,它不起作用。这是fusiontableslayer的限制吗?

    var Mu = new google.maps.FusionTablesLayer({
        query: {
            select: 'geometry',
            from: '1Md0G-C9PCc4ulq7hDyOPn8ZCaJ0a5WHyATrPC3Q',
            where: "name = '02005'"
        },

            styles: [{
                polygonOptions: {
                    fillColor: "#ff9900",
                    fillOpacity: 0.7,
                    strokeColor: "#808080",
                    strokeWeight: 6
                }
            }]

    });
    Mu.setMap(map);

    var mun = new google.maps.FusionTablesLayer({
        query: {
            select: 'geometry',
            from: '1Md0G-C9PCc4ulq7hDyOPn8ZCaJ0a5WHyATrPC3Q',

        },

            styles: [{
                polygonOptions: {
                    fillColor: "#008000",
                    fillOpacity: 1.0,
                    strokeColor: "#000080",
                    strokeWeight: 1
                }
            }]

    });
    mun.setMap(map);

1 个答案:

答案 0 :(得分:1)

documentation under "Limits"中所述,可以在一个地图上加载最多5个FusionTablesLayers(无论是来自同一个表还是多个表),这些层中只有一个可以是动态设计最多5种样式。