K
K
kozhemyakina19962018-05-24 00:23:18
Google
kozhemyakina1996, 2018-05-24 00:23:18

Is it possible to get a list of regions from a google map made through pivot tables?

I have a google map based on pivot tables (FusionTablesLayer).

Can you please tell me if I can somehow get a list of all the regions indicated in this map and make it so that when you click on an element from this list, the corresponding balloon opens?

Here is an example of a map air-in.ru/ajax/chat/test.php

if (isMobile) {
        var viewport = document.querySelector("meta[name=viewport]");
        viewport.setAttribute("content", "initial-scale=1.0, user-scalable=no");
    }

    var mapDiv = document.getElementById("googft-mapCanvas");
    mapDiv.style.width = isMobile ? "100%" : "500px";
    mapDiv.style.height = isMobile ? "100%" : "300px";

    var map = new google.maps.Map(mapDiv, {
        center: new google.maps.LatLng(56.32085914650647, 62.40977352913535),
        zoom: 4,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    });
    map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(document.getElementById('googft-legend-open'));
    map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(document.getElementById('googft-legend'));

    layer = new google.maps.FusionTablesLayer({
        map: map,
        heatmap: { enabled: false },
        query: {
            select: "col0",
            from: "1XlnmbK0m0s4rHdadG_hkmZP-dSr2ruBzQxnMK4Uv",
            where: ""
        },
        options: {
            styleId: 2,
            templateId: 2
        }
    });
    console.log(map);

    if (isMobile) {
        var legend = document.getElementById('googft-legend');
        var legendOpenButton = document.getElementById('googft-legend-open');
        var legendCloseButton = document.getElementById('googft-legend-close');
        legend.style.display = 'none';
        legendOpenButton.style.display = 'block';
        legendCloseButton.style.display = 'block';
        legendOpenButton.onclick = function() {
            legend.style.display = 'block';
            legendOpenButton.style.display = 'none';
        }
        legendCloseButton.onclick = function() {
            legend.style.display = 'none';
            legendOpenButton.style.display = 'block';
        }
    }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question