Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am working on a map that will incorporate both Fusion Tables and KML layers, parsed through geoXML3. As my Fusion Table Layer is a point file I would like it to always be on top of the KML's which will be polygons. By default when the page first loads the Fusion Table will be loaded, while the KML's are turned on by the user through some check boxes. It seems like because the Fusion table loads first it always gets stuck on the bottom. I tried to fix this by turning it off when parsing/ displaying the KML data and then turning it back on after the call to parse the data but this does not seem to work. Does anyone have an idea of how I could make it so the Fusion Table Layer is always on top?

Below is a sample of my code right now which doesn't work:

    function initialize() {
var myLatlng = new google.maps.LatLng(43.705199, -79.421707);
var myOptions = {
zoom: 12,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById('map_canvas'), myOptions);

kml_FOS = new geoXML3.parser({map: map, zoom: false});
kml_Neighbourhood = new geoXML3.parser({map: map, zoom: false});
kml_Municipal = new geoXML3.parser({map: map, zoom: false});
kml_SSI_University_Aggregate_V01 = new geoXML3.parser({map: map, zoom: false, suppressInfoWindows: false});

roadFusionLayer2 = new google.maps.FusionTablesLayer(fusionTableID,{suppressInfoWindows: false});
roadFusionLayer2.setMap(map);
}


function boundaryToggle_FOS() {
if (boundaryIsLoaded_FOS == 0)
{
boundaryIsLoaded_FOS = 1;
    if (firstLoadFOS == 0)
        {
        //turn off fusion table layer
        roadFusionLayer2.setMap(null);
        //Parse the kml
        kml_FOS.parse('FOS_Boundary_v03.kml');
        //Turn Fusion Table ON
        roadFusionLayer2.setMap(map);
        firstLoadFOS = 1;
        }
    else
        {
        roadFusionLayer2.setMap(null);
        kml_FOS.showDocument();
        roadFusionLayer2.setMap(map);
        }
}
else
{
    kml_FOS.hideDocument();
    boundaryIsLoaded_FOS = 0;
}
}
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.